![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home --- Topics --- Articles --- Offers --- Register --- Contact us | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Did you know? if you register at Hamid School you can save up to 45% on hosting packages offered by Surreyhost.com . Don't miss out, every minute counts! Are you Confused? Click here to learn how to use hamid school CSS Pseudo elementsSyntaxThe syntax of pseudo-elements:
CSS classes can also be used with pseudo-elements:
The :first-line Pseudo-elementThe "first-line" pseudo-element is used to add special styles to the first line of the text in a selector:
The output could be something like this:
In the example above the browser displays the first line formatted according to the "first-line" pseudo element. Where the browser breaks the line depends on the size of the browser window. Note: The "first-line" pseudo-element can only be used with block-level elements. Note: The following properties apply to the "first-line" pseudo-element:
The :first-letter Pseudo-elementThe "first-letter" pseudo-element is used to add special style to the first letter of the text in a selector:
The output could be something like this:
Note: The "first-letter" pseudo-element can only be used with block-level elements. Note: The following properties apply to the "first-letter" pseudo- element:
Pseudo-elements and CSS ClassesPseudo-elements can be combined with CSS classes:
The example above will make the first letter of all paragraphs with class="article" red. Multiple Pseudo-elementsSeveral pseudo-elements can be combined:
The output could be something like this:
In the example above the first letter of the paragraph will be red with a font size of 24pt. The rest of the first line would be blue while the rest of the paragraph would be the default color. CSS2 - The :before Pseudo-elementThe ":before" pseudo-element can be used to insert some content before the content of an element. The style below will play a sound before each occurrence of an <h1> element:
CSS2 - The :after Pseudo-elementThe ":after" pseudo-element can be used to insert some content after the content of an element. The style below will play a sound after each occurrence of an <h1> element:
Pseudo-elementsBrowser support: IE: Internet Explorer, F: Firefox, N: Netscape. W3C: The number in the "W3C" column indicates in which CSS recommendation the property is defined (CSS1 or CSS2).
Viewed:268
Did you know? if you register at Hamid School you can learn web programming and designing for free and also you can save up to 45% on hosting packages offered by Surreyhost.com . Don't miss out, every minute counts!
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Sponsored by: Surreyhost.com Coded and designed by: Hamid Moudi HPLA |
||||||||||||||||||||||||||||||||||||||||||||||||||||||