Html:
<body>
<div>
<header>
HTML5
</header>
<nav>
<ul>
<li><a href="">Home</a></li>
<li><a href="">Logout</a></li>
<li><a href="">Login</a></li>
</ul>
</nav>
<p id="navclear" />
css:
/*page*/
body{
margin:0 auto;
width: 800px;
height:auto;
border: 1px solid black;
}
/*navigation*/
nav{
border: 1px solid black;
background-color: #E3E3E3;
height:auto;
}
nav ul{
list-style:none;
padding:0;
!margin-top:0;
}
nav li a{
float:left;
text-decoration:none;
display: block;
padding-right:5px;
width:75px;
background-color: #E3E3E3;
color:#66777F;
!line-height: .5em;
font-weight: bold;
font-family:Cantarell, Arial, Helvetica, sans-serif;
}
nav li a:hover{
color: #FE4C06;
}
#navclear{
clear:both;
}
I am new to html5. Here i am facing problem with height property.I want to make my my nav height auto i tried the same with above syntax but the ul part overflowed from nav.Means height:auto; not working . i cant fix the same by nav ul {margin-top:0;}. Here my question is how to make nav height auto?