[size=medium]here is a very little used and unknown method which allows you to utilise JavaScript within a CSS file. The CSS Expression property allows you to assign a JavaScript expression to a CSS property. For example, this allows you to set the position of an element according to the browser size.
[/code]
Do not use CSS Expression, they are unreliable, slow and are only supported in IE!
CSS Expression suddenly came to me as a solution for the currently much debated feature (here and here) of variables in CSS3. This could theoretically be currently achieved through the use of CSS Expressions.
[/code]
CSS Expressions are horrible and unsupported, so please don’t use them in development. They do, however, highlight a interesting and little known feature of CSS.[/size]
[code="css"]
width:expression(document.body.clientWidth > 950 ? "950px": "100%" );
[/code]
Do not use CSS Expression, they are unreliable, slow and are only supported in IE!
CSS Expression suddenly came to me as a solution for the currently much debated feature (here and here) of variables in CSS3. This could theoretically be currently achieved through the use of CSS Expressions.
[code="css"]
function blue() {
return 'blue';
}
body { background: expression(blue()); }
[/code]
CSS Expressions are horrible and unsupported, so please don’t use them in development. They do, however, highlight a interesting and little known feature of CSS.[/size]