CSS pseudo elements & pseudo classes

CSS Pseudo Elements

:after
Adds content after an element

:before
Adds content before an element

:first-letter
Adds a style to the first character of a text

:first-line
Adds a style to the first line of a text

example:
h1:after
{
content:url(smiley.gif);
}

Posted on 5 Oct 2009, 17:00 – Category: CSS
CommentsEditDelete

Pseudo Classes

:active
Adds a style to an element that is activated

:first-child
Adds a style to an element that is the first child of another element

:focus
Adds a style to an element that has keyboard input focus

:hover
Adds a style to an element when you mouse over it

:lang
Adds a style to an element with a specific lang attribute

:link
Adds a style to an unvisited link

:visited
Adds a style to a visited link

Leave a Reply

You must be logged in to post a comment.