Tuesday, September 1, 2009

Pseudo Elements

allow to extend selectors - to be more specific
allow to match elements in doc that don't appear specificly in the doc tree
eg. 1st letter of paragraph - pseudo element
- is identified in css1 & css2 by : , pseudo class is identified by :: in css3


style type="text/css">

p:first-letter {
font-size:2em;
color:#3C3;
}
/style>
/head>

body>
p>text yes it is text text yes it is text/p>
/body>



Only fully supported by Firefox and Safari at this time
partially supported by Opera

style type="text/css">
p:first-line {
text-transform:capitalize;
color:#3C3;
}
/style>
/head>

body>
p>text yes it is text text yes it is text text yes it is text text yes it is text text yes it is text text yes it is text text yes it is text text yes it is text text yes it is text text yes it is text/p>
/body>


* = everything

*:selection {
background:#0F0;
color:#F00;

- any text selected by the user will be coloured by the user
}

No comments:

Post a Comment