CSS Clear Clear floating

Source: Internet
Author: User

1. The clear in CSS has four parameters:

None: Allows both sides to float.

Left: does not allow floating on the side.

Right: Do not allow floating on the left.

Both (default); floating is not allowed.

2, at the beginning of the CSS in the clear float is the default both, that is, in the beginning can not be floating.

3, use of the case: Suppose I clear the third Div floating

<style type= "Text/css" >
div{
border:1px solid red;
Float:left;
Clear:none;
}
#msg_Div {
width:600px;
height:600px;
}
. one{
width:100px;
height:90px;
}
. two{
width:100px;
height:90px;
}
. three{
width:100px;
height:90px;
Clear:left;
}
. four{
width:100px;
height:90px;
}
. five{
width:100px;
height:90px;
}
</style>

<body>
<div id= "Msg_div" >
<div class= "One" ></div>
<div class= "both" ></div>
<div class= "three" ></div>
<div class= "Four" ></div>
<div class= "Five" ></div>
</div>
</body>

Effect:

   

CSS Clear Clear floating

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.