I know this should be simple, but I can't figure it out. I want to have a vertical navigation menu on the left side of a page with the main content of the page next to it. In this example, I want GOOGLY GOOGLY to display to the right of the menu, not below it. How do I make both columns start at the top? Thank you!
[updated--sorry about the copy-paste problem]
CSS
#vamain
{
float: left;
width: 100;
}
#vowelaltnav
{
/*avoid gap after li in ie6 by setting width*/
float: left
width: 130px;
font-size: 11px;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
margin-left: 30px;
}
#vowelaltnav ul
{
list-style-type: none;
margin-left: 0;
padding-left: 0;
}
#navlist a
{
display: block;
color: #8592BB;
padding: 8px 0 8px 8px;
}
/*boxmodel hack. http://css-discuss.incutio.com/?page=BoxModelHack SBMH*/
#navlist a { width: 114px; }
#navlist a
{
\width: 130px;
w\idth: 114px;
}
#subnavlist a
{
display: block;
color: #9C9C9C;
padding: 8px 0 8px 8px;
margin-left: 8px;
}
/*boxmodel hack. http://css-discuss.incutio.com/?page=BoxModelHack SBMH*/
#subnavlist a { width: 106px; }
#subnavlist a
{
\width: 122px;
w\idth: 106px;
}
#navlist a, #navlist a:visited,#subnavlist a, #subnavlist a:visited
{
border-left: 8px solid #FFFFFF;
background: #FFFFFF;
color: #9C9C9C;
text-decoration: none;
}
#navlist a:hover, #navlist a#current:hover
{
border-left: 8px solid #CCCCCC;
text-decoration: underline;
}
#subnavlist a:hover, #subnavlist a#subcurrent:hover
{
border-left: 8px solid #CCCCCC;
text-decoration: underline;
}
a#current, a:visited#current, a#subcurrent , a:visited#subcurrent
{
border-left: 8px solid #283D82;
background: #F3F5FC;
color: #283D82;
text-decoration: none;
}
HTML
<div id="vowelaltnav">
<ul id="navlist">
<li id="active"><a href="#" id="current">Item one</a>
<ul id="subnavlist">
<li id="subactive"><a href="#" id="subcurrent">Subitem one</a></li>
<li><a href="#">Subitem two</a></li>
<li><a href="#">Subitem three</a></li>
<li><a href="#">Subitem four</a></li>
</ul>
</li>
<li><a href="#">Item two</a></li>
<li><a href="#">Item three</a></li>
<li><a href="#">Item four</a></li>
</ul>
</div>
<div id="vamain">
<p> GOOGLY GOOGLY </p>
</div>
You have plenty of typos in your CSS which contribute to it not working correctly. Here are the ones you need to fix:
Line 3: Width: 100;
-> width: 100px;
Line 11: float: left
-> float: left;
Line 37, 38, 54, 55: Remove the slashes from width
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments