CSS Advanced Tutorial pseudo elements

Source: Internet
Author: User
Pseudo-elements (pseudo elements) suck selectors like pseudo-classes, using selector:pseudoelement {property:value;} The form. There are four sucking device.
First word and first line
The first word first-letter the pseudo-element to the first word of the element, while the first line first-line is the top row of the element. You can, for example, create a paragraph with a first line of bold and drop caps, like this:
P:first-letter {
Font-size:3em; Float:left;
}
P:first-line {
Font-weight:bold;
}
Front and rear
The pre-before and post-after pseudo-elements and content properties are used on both sides of the element, changing the contents of both sides of the content without changing the HTML.
The value of the content property can be open-quote (open quotes), close-quote (closed parenthesis), no-open-quote (no opening brackets), no-close-quote (no closing brackets), any strings enclosed in quotation marks, or pictures, using a URL ( imagename).
Blockquote:before {
Content:open-quote;
}
Blockquote:after {
Content:close-quote;
}
Li:before {
Content: "POW:"
}
P:before {
Content:url (images/jam.jpg)
}
Attention
Sounds good, dunnit? Well, there are so many things (alas, a sigh) that most users can't see the effects before and after because IE is bothered by them. Languid......

More CSS Advanced Tutorials Pseudo-element related articles please follow topic.alibabacloud.com (www.php.cn)!

  • 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.