Forum Moderators: not2easy
How do I make a display: inline; list show 100% width on the browser? Even when resized? Can I do this?
Here is my HTML code.
<div id="navcontainer" align="center">
<ul id="navlist">
<li class=#navlist li a#current><a href="#">WIDGETS</a></li>
<li class="header"><a href="#">WIDGETS</a></li>
<li><a href="#">WIDGETS</a></li>
<li><a href="#">WIDGETS</a></li>
<li><a href="#">WIDGETS</a></li>
<li><a href="#">WIDGETS</a>
</ul>
</div>
<div id="navcontainer" align="center">
<ul id="navlist2">
<li class=#navlist li a#current>
<li><a href="#">WIDGETS</a></li>
<li><a href="#">WIDGETS</a></li>
<li><a href="#">WIDGETS</a></li>
<li><a href="#">WIDGETS</a></li>
<li><a href="#">WIDGETS</a></li>
<li><a href="#">WIDGETS</a></li>
<li><a href="#">WIDGETS</a></li>
<li><a href="#">WIDGETS</a></li>
<li><a href="#">WIDGETS</a>
<hr align="center">
<br>
</li>
</ul>
</div>
Here is the CSS
<!--
#navlist
{
padding: 0px 0;
margin-left: 0;
font: bold 11px Verdana, sans-serif;
background: #EED;
}
#navlist2
{
padding: 0px 0;
margin-left: 0;
font: bold 9px Verdana, sans-serif;
}
#navlist li
{
list-style: none;
margin: 0;
display: inline;
}
#navlist2 li
{
list-style: none;
margin: 0;
display: inline;
}
#navlist li a
{
padding: 4px .5em;
margin-left: 1px;
border: 0px solid #778;
border-bottom: none;
background: #003399;
text-decoration: none;
}
#navlist2 li a
{
padding: 4px .5em;
margin-left: 1px;
border: 1px solid #778;
border-bottom: none;
background: #EED;
text-decoration: none;
}
#navlist li a:link { color: white; }
#navlist li a:visited { color: white; }
#navlist2 li a:link { color: #448; }
#navlist2 li a:visited { color: #448; }
#navlist li a:hover
{
color: #000;
background: #AAE;
border-color: #227;
}
#navlist2 li a:hover
{
color: #000;
background: #AAE;
border-color: #227;
}
#navlist li a#current
{
background: white;
border-bottom: 1px solid white;<br
}
#navlist2 li a#current
{
background: white;
border-bottom: 1px solid white;
}
-->
Let me know what you think. Any comments on what I am doing wrong? Thanks!
How do I make a display: inline; list show 100% width on the browser? Even when resized? Can I do this?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<style type="text/css" media="all">
html,body,ul,li {
margin:0;
padding:0;
}
ul li {
display:block;
float:left;
width:20%;
text-align:center;
}
ul li a {
display:block;
border:1px solid green;
background:yellow;
color:black;
text-decoration:none;
}
ul li a:hover {
background:blue;
color:white;
}
</style>
</head>
<body>
<ul>
<li><a href="">Widgets</a></li>
<li><a href="">Widgets</a></li>
<li><a href="">Widgets</a></li>
<li><a href="">Widgets</a></li>
<li><a href="">Widgets</a></li></ul>
</body>
</html>