I ran into an interesting application of CSS yesterday, that, while not useful 
for most people, might be in the "fun to know" category for others.

I write software that interfaces with a government website through an 
embedded browser, and we're working on a UI overhaul.  Unfortunately for us, 
the government site is ugly as sin, but someone had the idea of substituting 
our own stylesheet to try and give it a make-over.

So I set to doing that, but got a bit discouraged when I looked at the source 
and saw things like:

<td valign="top" bgcolor="#445588">

But then I noticed that in Firebug, this was translated into CSS as 

td[valign="top"] {
  vertical-align: top;
}

td[bgcolor="#445588"] {
  background-color: #458;
}

So I put the following rule in the stylesheet:
[bgcolor] {background-color: transparent}

and it worked!  All the HTML elements with bgcolor were reset!

So, apparently, it's possible, using CSS, to override element styles not set 
using CSS.  I can't really think of any common usages for this, but it might 
be handy some time if you need to redo a site and don't have control over 
the HTML source.

---Tim
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to