div background color not setting all area

后端 未结 5 1472
我在风中等你
我在风中等你 2021-01-26 05:00

I have a div containing 3 div inside it. My problem is when am setting background color to first div, the div inside first div is not applying the background.

My code is

5条回答
  •  借酒劲吻你
    2021-01-26 05:31

    When you use floating elements inside a wrapper you need to clear them. There are various ways to clear them using clearfix technique, using overflow:hidden, etc.

    So, you need to do just:

    .how_next {
       overflow: hidden;
    }
    

    You may have an interest in these q/a:

    what is clearfix

    which method of clearfix is best

    clearfix with twitter bootstrap

    all about floats

提交回复
热议问题