Hi
I must be wrong, because its surely a basic feature, but it seems that it
is not possible to define a selector which matches elements which *dont*
have a particular attribute.
I am taking HTML which contains alignment attributes on table cells where
the originating software considers this
Subject: [css-d] selector for missing attribute?
Hi
I must be wrong, because it's surely a basic feature, but it seems that it
is not possible to define a selector which matches elements which *don't*
have a particular attribute.
I am taking HTML which contains alignment attributes on table cells
On Sun, 22 Jul 2007, Trevor Nicholls wrote:
I must be wrong, because its surely a basic feature, but it seems that it
is not possible to define a selector which matches elements which *dont*
have a particular attribute.
You're wrong in assuming that you must be wrong. :-)
It is not
On Sun, 22 Jul 2007, Joe Schmitt wrote:
caption, th, td {
text-align: left;
}
Now all browsers (including IE) will left align the th elements as the
default.
They will, but this works all too well: align attributes in HTML markup
will not override it. By the CSS cascade rules - and
Sent: Sunday, July 22, 2007 3:52 AM
Subject: Re: [css-d] selector for missing attribute?
On Sun, 22 Jul 2007, Joe Schmitt wrote:
caption, th, td {
text-align: left;
}
Now all browsers (including IE) will left align the th elements as the
default.
They will, but this works all too
Thank you Jukka Joe for your answers
The remaining problem is that on browsers that do not support attribute
selectors, such as IE 6 and earlier, the style sheet would make _all_ th
elements left-aligned. Thus, this might be one of (rare) cases where some
trick for hiding the first rule from
Trevor Nichols wrote:
Rats. Almost all our tables have left aligned column
headings, and I hoped to make that the default so that
alignment only needed specifying occasionally.
Not sure if this solves your problem but (in addition to Jukka's suggestion
for good browsers) you could feed IE6 a