W3C home > Mailing lists > Public > www-style@w3.org > March 2004

@try in CSS3 (was: Useragent Rules in CSS)

From: Chris Moschini <cmoschini@myrealbox.com>
Date: Wed, 31 Mar 2004 10:30:07 -0500
To: www-style@w3.org
Message-ID: <1080747007.983499bccmoschini@myrealbox.com>

Christoph Paper:
> Like already proposed, the minimal solution was a grouping at-rule, like
>
> @batch {
>    foo {property1: value; property2: value}
> }
>
> If the browser can apply *all* rulesets inside, they are, else none of them.

First of all, I realize what this syntax is now - it's essentially multiple try
blocks.


> Can anyone provide an example which this approach cannot solve?

Sadly, I can:

@try {
	#myDiv {
		width: 100px;
		margin: 1px;
	}
}

Internet Explorer would incorrectly draw the block 98px wide, even though it
technically supports all that's in the @try. However - it's better than nothing.
If I take IE's total profile into account I can lock it out nicely:

@try {
	body>#myDiv {
		width: 100px;
		margin: 1px;
	}
}
@catch {
	#myDiv {
		width: 102px;
		margin: 1px;
	}
}

I like this idea.

-Chris "SoopahMan" Moschini
http://hiveminds.info/
http://soopahman.com/
Received on Wednesday, 31 March 2004 10:34:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:27 GMT