개발관련/CSS/CSS3
[CSS]CSS Advanced - CSS Pseudo-elements
파노카페
2012. 10. 24. 01:45
출처: http://www.w3schools.com/css/css_pseudo_elements.asp
CSS pseudo-elements are used to add special effects to some selectors.
All CSS Pseudo Classes/Elements
Selector | Example | Example description |
---|---|---|
:link | a:link | Selects all unvisited links |
:visited | a:visited | Selects all visited links |
:active | a:active | Selects the active link |
:hover | a:hover | Selects links on mouse over |
:focus | input:focus | Selects the input element which has focus |
:first-letter | p:first-letter | Selects the first letter of every <p> element |
:first-line | p:first-line | Selects the first line of every <p> element |
:first-child | p:first-child | Selects every <p> elements that is the first child of its parent |
:before | p:before | Insert content before every <p> element |
:after | p:after | Insert content after every <p> element |
:lang(language) | p:lang(it) | Selects every <p> element with a lang attribute value starting with "it" |
CSS Pseudo-elements
Make the first letter special in a text
Make the first line special in a text
Make the first letter and first line special
Use :before to insert some content before an element
Use :after to insert some content after an element