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)!