[CSS] float-clear floating method

Source: Internet
Author: User

Method of clearing floating: inner wall method

Note: This is a kinky trick, there is no principle to say, remember can

This technique also allows the parent box to re-open the height of the box.

Partition method-Suitable for up and down arrangement between 2 box

Since 2 box heights are still 0, the margin between each other is not in effect. You can use a wall to open it.

        .cl {            clear: both;        }        .h16 {            height: 16px;        }
<div class="box1">    <ul>        <li>HTML</li>        <li>CSS</li>        <li>JS</li>    </ul></div><div class="cl h16"></div><div class="box2">    <ul>        <li>学习方法</li>        <li>英语水平</li>        <li>面试技巧</li>    </ul></div>
Overflow:hidden

Note: This is a kinky trick, there is no principle to say, remember can

It also allows the parent box to open the height of the box.

Use of appendix Overflow:hidden

Indicates "overflow hiding". All the contents of the overflow border will be hidden away.

[CSS] float-clear floating method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.