The HTML and CSS 'float' property

This question already has an answer here:

  • How do you keep parents of floated elements from collapsing? [duplicate] 16 answers

  • 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 ;)

    链接地址: http://www.djcxy.com/p/88440.html

    上一篇: 这个简单的HTML,CSS布局有什么问题?

    下一篇: HTML和CSS'浮动'属性