Hello all,
I have ALWAYS used tables to design web pages, and I'm finally trying to break into the more "complicated" world of CSS. I've done a number of online tutorials and feel like I've learned quite a bit, but I'm obviously a total newbie. I've written the following CSS for a friend's website, and it looks fantastic in IE but fails in FF. I know that means something's wrong with my CSS, as FF is very strict in rendering pages just as they're described. I've validated both my HTML and CSS at W3C and it comes up clean, so I'm obviously just not understanding some basic principle.
First, here's the url: http://www.mightymichaelis.com/rmv/
Now, there are a number of issues with it that I'm still trying to work out, but the one that's really irking me that I'd like some advice on is the navigation bar. You'll note that in IE it displays in the center of the navigation container's background image, but in FF it hangs out on the left side. Why is that? What am I misunderstanding?
Here's the CSS:
* {
vertical-align: baseline;
font-weight: inherit;
font-family: inherit;
font-style: inherit;
font-size: 100%;
border: 0 none;
outline: 0;
padding: 0;
margin: 0;
}
body
{
margin: 0;
padding: 0;
font: 85% arial, hevetica, sans-serif;
text-align: center;
color: #000;
}
#container
{
width: 800px;
background-image: url(background.gif);
background-repeat: repeat-y;
background-position: center;
}
#navcontainer
{
width: 800px;
height: 39px;
background-image: url(navbar.gif);
position: relative;
}
#nav {
margin-top: 2px;
padding: 0;
height: 31px;
list-style: none;
display: inline;
overflow: hidden;
}
#nav span {
display: none;
}
#nav li {
margin: 0;
padding: 0;
list-style: none;
display: inline;
}
#nav a {
float: left;
display: block;
padding: 31px 0 0 0;
overflow: hidden;
height: 0px !important;
height /**/:31px; /* for IE5/Win only */
}
#nav a:hover {
background-position: 0 -31px;
}
#nav a:active, #nav a.selected {
background-position: 0 -62px;
}
#thome a {
width: 85px;
background: url(home.gif) top left no-repeat;
}
#tabout a {
width: 93px;
background: url(about.gif) top left no-repeat;
}
#tservices a {
width: 114px;
background: url(services.gif) top left no-repeat;
}
#tequipment a {
width: 120px;
background: url(equipment.gif) top left no-repeat;
}
#tcontact a {
width: 96px;
background: url(contact.gif) top left no-repeat;
}
#contents
{
margin: 10px;
padding: 20px;
width: 500px;
text-align: left;
}
#footer
{
margin: 0;
padding: 0;
}
And here's my HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>
</title>
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<center>
<div id="container">
<div id="header">
<img src="./header.jpg" alt="Rolla Works Vending">
</div>
<div id="navcontainer">
<ul id="nav">
<li id="thome"><a href="/" class="selected"><span>Home</span></a></li>
<li id="tabout"><a href="#"><span>About</span></a></li>
<li id="tservices"><a href="#"><span>Services</span></a></li>
<li id="tequipment"><a href="#"><span>Equipment</span></a></li>
<li id="tcontact"><a href="#"><span>Contact</span></a></li>
</ul>
</div>
<div id="menu"></div>
<div id="contents">
This is the text in the container.This is the text in the container.This is the text in the container.This is the text in the container.This is the text in the container.This is the text in the container.This is the text in the container.This is the text in the container.This is the text in the container.This is the text in the container.This is the text in the container.This is the text in the container.This is the text in the container.This is the text in the container.This is the text in the container.This is the text in the container.This is the text in the container.
</div>
</div>
<div id="footer">
<img src="./footer.gif" alt="Rolla Works Vending">
</div>
</center>
</body>
</html>
Any help will be appreciated! Thank you!