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

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 UTC