The HTML and CSS 'float' property
This question already has an answer here:
Edit : Ok I saw your website now, one solution is to add a <div class="clearfix">
after the h3
element. Then you style this div
:
.clearfix{
clear: both;
}
First answer: If I understand your problem, you just want your white background covering your header. Since your header is position: relative
, the code below should work :
header div{
background-color: rgba(255,255,255,0.80)
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
}
It simply set your white layer to position:absolute
and stretch it to cover the container block, which is your header ;)
下一篇: HTML和CSS'浮动'属性