6StringGeek
02-13-2009, 03:39 PM
This is driving me nuts. This is a simple menu using *cough* a table. For some reason it does not align vertically. I colored the background and put borders on the menu items to make it obvious. I always thought tables stretched for content...
I am not smart about tables...so it could be my lack of experience getting me. Any help appreciated!
Here's the html:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>nav</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrap">
<table width="100%" border="0">
<tr>
<td><a href="#" title="#">about us</a></td>
<td><a href="#" title="#">products</a></td>
<td><a href="#" title="#">something</a></td>
<td><a href="#" title="#">contact</a></td>
<td><a href="#" title="#">shopping</a></td>
</tr>
</table>
</div>
</body>
</html>
and the css:
html,body {
height:100%;
font:100.1% tahoma, sans-serif;
}
body {
background:#fff;
text-align:center;
margin:0 auto;
}
#wrap {
width:960px;
margin:0 auto;
padding:0;
}
a {
color:#000;
font-size:.8em;
text-decoration:none;
text-align:center;
letter-spacing:3px;
margin:0 auto;
padding:4px 20px;
background: #fff;
font-weight: normal;
vertical-align: middle;
border: 1px solid #000;
}
A:link {text-decoration: none}
A:visited {text-decoration: none}
A:active {text-decoration: none}
A:hover {text-decoration: underline; color: red;}
table {
background: #bbb;
}
I am not smart about tables...so it could be my lack of experience getting me. Any help appreciated!
Here's the html:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>nav</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrap">
<table width="100%" border="0">
<tr>
<td><a href="#" title="#">about us</a></td>
<td><a href="#" title="#">products</a></td>
<td><a href="#" title="#">something</a></td>
<td><a href="#" title="#">contact</a></td>
<td><a href="#" title="#">shopping</a></td>
</tr>
</table>
</div>
</body>
</html>
and the css:
html,body {
height:100%;
font:100.1% tahoma, sans-serif;
}
body {
background:#fff;
text-align:center;
margin:0 auto;
}
#wrap {
width:960px;
margin:0 auto;
padding:0;
}
a {
color:#000;
font-size:.8em;
text-decoration:none;
text-align:center;
letter-spacing:3px;
margin:0 auto;
padding:4px 20px;
background: #fff;
font-weight: normal;
vertical-align: middle;
border: 1px solid #000;
}
A:link {text-decoration: none}
A:visited {text-decoration: none}
A:active {text-decoration: none}
A:hover {text-decoration: underline; color: red;}
table {
background: #bbb;
}