Articles Tagged 'Styles'

Very short trick: Conditional CSS and optimization

The use of conditions within the browser is often used to decide which style sheet to load depending on the type of browser. For example we can use this code to load a particular style sheet when the browser is Internet Explorer 6:

Continued ...

Inserting text with CSS: IE7, a bad deal

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 content of a site acting exclusively 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
> fogli di stile < / span >< / p > < p > I can insert characters with < span > stylesheets </ span > </ p >
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!

Continued ...


Stop SOPA