[CSS]CSS Advanced - CSS Pseudo-classes
개발관련/CSS/CSS3 2012. 10. 24. 01:32 |출처: http://www.w3schools.com/css/css_pseudo_classes.asp
CSS pseudo-classes 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-classes
Add different colors to a hyperlink
Add other styles to hyperlinks
Use of :focus
:first-child - match the first p element
:first-child - match the first i element in all p elements
:first-child - Match all i elements in all first child p elements
Use of :lang
'개발관련 > CSS/CSS3' 카테고리의 다른 글
[CSS]CSS Advanced - CSS Navigation Bars (0) | 2012.10.24 |
---|---|
[CSS]CSS Advanced - CSS Pseudo-elements (0) | 2012.10.24 |
[CSS]CSS Advanced - CSS Aligning Elements (0) | 2012.10.24 |
[CSS]CSS Advanced - CSS Floating (0) | 2012.10.23 |
[CSS]CSS Advanced - CSS Positioning (0) | 2012.10.23 |