Forum Moderators: not2easy
(unrelated css…)
body#footerB {
background-image: url(../graphics/footer.jpg);
background-repeat: repeat-x;
text-align:center;
margin: 0px 0px 0px 0px;
}
div.centerBox {
align-left: auto;
align-right: auto;
background-color: red;
}
ul.rowLinks {
margin-top: 0px;
list-style-type: none;
background-color: blue;
}
li.rowLinks1 {
margin: 0px 20px 0px 0px;
list-style-type: none;
font-weight: bold;
float: left;
background-color: purple;
}
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/HTML4.01/loose.dtd">
<html>
<head>
(title and tags….)
<link rel="stylesheet" href="../css/markup.css" type="text/css">
</head>
<body id="footerB">
<div class="centerBox">
<ul class="rowLinks">
<li class="rowLinks1”> some link</li>
<li class="rowLinks1”> some link</li>
<li class="rowLinks1”> another link</li>
<li class="rowLinks1”> more links?</li>
</ul>
</div>
</body>
</html>
Try replacing your float:left; with display:inline; and I think that should give you the effect you want.
Also you might want to check out this article on lists [alistapart.com], it should be helpful.
Reflection is correct it is the float: left which causes the "disappearing" div at least in everything but IE, don't know what you're using to test but this should work in IE.
However there are is an error in your HTML code but I don't know if it's a typo or a paste error just?
<li class="rowLinks1”> more links?</li>
Then in the CSS for div.centerBox:
align-left: auto;
align-right: auto;
and you will need to give it a width so it knows what to center.. so try this instead:
div.centerBox {
margin: 0 auto;
width: 500px;
background-color: red;
}
so now you should see the colors in IE anyway.. then to overcome the floated elements not "filling" the centerBox because they are floated there are 2 methods you can use..
1. Use the "clear: both;" method
or another method which involves no extra markup ;)
2. use generated content property method
IE will not understand method no. 2, but it doesn't need to as it already (incorrectly) stretches the parent div to surround the floats..
Suzy