W3C home > Mailing lists > Public > www-style@w3.org > January 2008

RE: Re[4]: css with attribues [software]

From: Alan Gresley <alan1@azzurum.com>
Date: Thu, 17 Jan 2008 10:00:24 -0700
To: Brad Kemper <brkemper@comcast.net>
cc: www-style@w3.org, Dmitry Turin <sql4-en@narod.ru>
Message-ID: <20080117100024.34b83c2f3c9bef00757a2c62c0fb7450.36f0c7874f.wbe@email.secureserver.net>

Brad Kemper wrote:

> On Jan 17, 2008, at 7:47 AM, Alan Gresley wrote:
> 
> > Can a CSS property be used as the attribute in Attribute Selectors?  
> > My answer is yes. I will allow this since no one can stop you from  
> > doing it. And the really great part about it is that it can be done  
> > already.
> >
> > http://css-class.com/test/css/selectors/property-attribute.htm
> >
> > Please find the CSS embedded in the source. It's fully valid XHTML  
> > 1.0 Transitional and valid CSS. The down size is that the only UA  
> > that it does work in is IE.
> 
> It does work in FireFox and Safari. Did you mean "doesn't"?

Yes you are correct. I should have said that "The down 'side' is that the only UA that it 'doesn't' work in is IE. Works in Opera, Safari, Gecko, and I guess many others. Some of what I wrote (repeated below) is incorrect, since how can any UA possibly support an unknown HTML attribute.

"Does this mean that any new attribute added to html and CSS will fail to work in IE7?"

The attribute in an Attribute selector can be of any value except perhaps those conatining certain non ASCII characters (I'm a novice here) so what is seen below is a valid CSS selector.

table[foobarstuff="food"] {text-align:right}

but with invalid HTML (unknown HTML attribute)

<table width="100%" border="100" foobarstuff="food"> ... </table>

An example from the spec 5.8.1 Matching attributes and attribute values:

span[hello="Cleveland"][goodbye="Columbus"] { color: blue; }

So depreciated or unknown HTML attributes can not be used as the value for the attribute in an Attribute Selector in IE7. I have done an extra test with an unknown attribute "foobarstuff".

http://css-class.com/test/css/selectors/property-attribute2.htm


Alan

http://css-class.com/
Received on Thursday, 17 January 2008 17:00:40 GMT

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