Use the pseudo object selector E: after to clear the floating effect.

Source: Internet
Author: User

Use the pseudo object selector E: after to clear the floating effect.

Use the pseudo object selector E: after to clear the floating:
There are too many articles to talk about floating clearance, and it is almost ruined.
This is of course because floating is a technique that is not needed in the center. It is also necessary to clear floating. However, this chapter is still worth a while and I will introduce another method to clear floating, this is because it will use a rare pseudo-object selector, hoping to attract everyone's attention.
Let's take a look at a code example:

<! DOCTYPE html> 

The above code is a common code for clearing floating. Although it can be used to clear floating, it is not perfect, because it will have an extra div tag, this will increase the pressure on the browser to interpret the page, and the page is not fresh enough, then we will use the pseudo object selector for transformation, the Code is as follows:

<! DOCTYPE html> 

In the above Code, use the: after pseudo object selector to create a pseudo element, set the content of this pseudo element to a vertex, and set it to block-level element and clear: both achieves the floating clearance effect.
Related reading:
1. For details about how to clear float, refer to css clear float summary.
2. E: after, you can refer to Chapter E: after/E: after, the pseudo object selector of CSS.

The original address is: http://www.softwhy.com/forum.php? Mod = viewthread & tid = 15391.

For more information, see: http://www.softwhy.com/divcss/

Related Article

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.