jaykayc
9th September 09, 10:55 PM
Greets everyone.
I'm having a bit of trouble getting an unordered list to sit properly inside my menu div. It works OK in FF but IE is giving me grief.
Here is the code:
index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="main.css" />
</head>
<body>
<div id="logo">
<p>Logo Goes Here</p>
</div>
<div id="menu">
<ul id="navlist">
<li><a href="#">Home</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">About Us</a></li>
</ul>
</div>
<div id="content">
<h1>Content Header</h1>
<p>Content goes here</p>
</div>
<div id="footer">
<p>Footer stuff here</p>
</div>
</body>
</html>
main.css
body {
margin: 0;
padding: 0;
border: 0;
background: yellow;
}
p {
padding: 0;
margin: 0;
}
#logo {
width: 100%;
text-align: center;
background: green;
margin: 0;
padding: 0;
height: 120px;
}
#menu {
width: 100%;
background: black;
text-align: center;
margin: 0;
padding: 0;
overflow: auto;
height: 42px;
}
ul#navlist {
font-family: Arial;
font-size: small;
font-weight: bold;
margin-left: 0;
padding-left: 0;
white-space: nowrap;
}
#navlist li {
display: inline;
list-style-type: none;
}
#navlist a {
padding: 10px 29px;
}
#navlist a:link, #navlist a:visited {
color: #fff;
background-color: blue;
text-decoration: none;
}
#navlist a:hover {
color: red;
text-decoration: none;
}
#content {
width: 750px;
margin: auto;
text-align: left;
padding: 0;
background: white;
}
#content p {
padding: 20px;
}
#footer {
width: 100%;
text-align: center;
}
#footer p {
color: black;
font-size: x-small;
padding: 15px;
}
Here is an image to demonstrate what is happening, the top being FF and the bottom IE:
http://img169.imageshack.us/img169/4931/problemy.png
If anyone knows how to fix this I'd greatly appreciate it! :-)
Thanks for looking.
I'm having a bit of trouble getting an unordered list to sit properly inside my menu div. It works OK in FF but IE is giving me grief.
Here is the code:
index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="main.css" />
</head>
<body>
<div id="logo">
<p>Logo Goes Here</p>
</div>
<div id="menu">
<ul id="navlist">
<li><a href="#">Home</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">About Us</a></li>
</ul>
</div>
<div id="content">
<h1>Content Header</h1>
<p>Content goes here</p>
</div>
<div id="footer">
<p>Footer stuff here</p>
</div>
</body>
</html>
main.css
body {
margin: 0;
padding: 0;
border: 0;
background: yellow;
}
p {
padding: 0;
margin: 0;
}
#logo {
width: 100%;
text-align: center;
background: green;
margin: 0;
padding: 0;
height: 120px;
}
#menu {
width: 100%;
background: black;
text-align: center;
margin: 0;
padding: 0;
overflow: auto;
height: 42px;
}
ul#navlist {
font-family: Arial;
font-size: small;
font-weight: bold;
margin-left: 0;
padding-left: 0;
white-space: nowrap;
}
#navlist li {
display: inline;
list-style-type: none;
}
#navlist a {
padding: 10px 29px;
}
#navlist a:link, #navlist a:visited {
color: #fff;
background-color: blue;
text-decoration: none;
}
#navlist a:hover {
color: red;
text-decoration: none;
}
#content {
width: 750px;
margin: auto;
text-align: left;
padding: 0;
background: white;
}
#content p {
padding: 20px;
}
#footer {
width: 100%;
text-align: center;
}
#footer p {
color: black;
font-size: x-small;
padding: 15px;
}
Here is an image to demonstrate what is happening, the top being FF and the bottom IE:
http://img169.imageshack.us/img169/4931/problemy.png
If anyone knows how to fix this I'd greatly appreciate it! :-)
Thanks for looking.