Div under a div
I'm kind of stuck on what seems to be something trivial but I just can’t get my head round it.
Basically I have the address div 开发者_如何学运维and then the menu..... Which should go under the address div but it’s seems to be floating next to the address div.
Any help will be much appreciated.
Add a clear
directive to your menu:
#contact-menu {
clear: both;
text-align:center;
padding-top:90px;
}
That tells the browser that there are no floating elements allowed on either side of the contact menu.
Add clear:both
to #contact-menu
.
Frankly, <br />
would probably do the trick. But if you're like me, you think that <br />
is for text only. #address{display: block;}#contact-menu{display: block;}
should do the trick, as block elements force a line break before and after the element. Didn't bother editing the CSS; hope it helps.
精彩评论