Do you know that CSS has a content property? What's the effect? What is the application? Can pseudo-class clear floating

Source: Internet
Author: User

know. the Content property of the CSS is specifically applied to the before/after pseudo-element, which is used to insert the generated content. The most common application is to use pseudo-classes to clear floats.

. clearfix:after {    content: ".";//the content attribute Display:block is used here    ;     height:0;    Visibility:hidden;     Clear:both; }.clearfix {     *zoom:1;}

After pseudo-elements generate block-level elements of a point after the element through the content, and then use Clear:both to clear the float.

So the question continues, Do you know the CSS counter (sequential numeric characters are automatically incremented)? How do I implement CSS counters with CSS content properties?

Answer:The CSS counter is implemented by setting Counter-reset, counter-increment two properties, and counter ()/counters () a method with the After/before pseudo-class.

  

Do you know that CSS has a content property? What's the effect? What is the application? Can pseudo-class 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.