Again, when I find myself writing about the capabilities of style sheets, I am forced to put aside Microsoft Internet Explorer! e after . With CSS2 introduced a very interesting feature, property, content , used in conjunction with pseudo-elements before and after . Through this "style" you can alter the contents of the site only by acting on the CSS file. For example if we write:
1 | content : ">>" } li: before {content: ">>"} |
) avrà ogni elemento preceduto dai caratteri “>>”! A bulleted list ( UL , LI ) will be preceded with every element ">>"! Anything, of course, can be treated in this way:
1 |
1 | content : "-->" } div p: before {content: "-->"} |
The versatility of this element does not stop there! It is possible to use other parameters in addition to the simple (but very useful) text. The element content , in fact, it also allows special values or url:
1 2 3 | content : url ( images/quote.gif ) } p: before {content: url (images / quote.gif)} content : close-quote } p: after {content: close-quote} content : url ( waves/sound.wav ) } p: before {content: url (waves / sound.wav)} |
For implementation details refer directly to the W3C - shame it does not even Microsoft!











Not to mention the attribute selectors css3 with
li a[lang="en"]you can create different links depending on the language or something ...@ Alex: Good point! , anch'essi non completamente supportati da IE . As well as the pseudo
:hoveror:focus, also not fully supported by IE. I think it's a shame they can never get 100% of the potential of CSS ... spriamo that the situation will improve in the near future!It is said that the version 8 respect for most elements css. We hope! I often find myself in the position of having to find a compromise layout in order to feel good both on Firefox and Safari, Explorer and on .. Sometimes I am even tempted to give up the nonsense of explorer, and design using full CSS .. then we just think: if it were not for that about 70% of users are still on Explorer!
Congratulations for your blog, hello to you soon!
@ Angelo: I too often the same as "temptation"