Add a bottom border to .mainnav
.mainnav {
border-bottom:1px solid #fff;
}
Domanda
I have a menu with background black and submenu with backgound grey.
Now I would like to have a pixel perfect divider between them.
But I have no idea what border color I should use to get pixel perfect divider. Can anyone help me?
Here is the html code
<!DOCTYPE html>
<html>
<body>
<div class="mainnav">
<p> This is main nav </p>
</div>
<div class="subnav">
<p> This is sub nav </p>
</div>
</body>
</html>
And here is my css
.mainnav {
width:100%;
height:60px;
background-color:#000000;
color:#ffffff;
text-align:center;
}
.mainnav p {
padding-top:20px;
}
.subnav p {
padding-top:10px;
}
.subnav {
width:100%;
height:45px;
background-color:#333;
color:#ffffff;
text-align:center;
}
Here is my jsfiddle.
Thanks.
Soluzione
Add a bottom border to .mainnav
.mainnav {
border-bottom:1px solid #fff;
}
Altri suggerimenti
I do not think you need any pixel perect devider! It is good as is. In any case, I do not think this site is for questions of this type, you should have a technical question here, not a question on how to make things look good.
I will add a dotted line between them
Add following line to mainnav css
border-bottom:1px dotted #fff;
Check this one on JSFiddle
http://jsfiddle.net/ruUgk/2/