[thelist] Defer CSS to user agent styles using Javascript?
Barney Carroll
barney at clickwork.net
Mon Oct 19 05:08:56 CDT 2009
Hello list,
Does anyone know of a way to define ultra-meak CSS rules? I am looking to
define presentational properties for HTML5 elements that should defer to
existing values if any are available. What I'm really looking for is
negative specificity, or a weakness value, for my selectors (which might not
be such a bad idea for CSS as a whole)…
I'm fairly certain there's no way of doing this with pure CSS — I imagine
there might be some Javascript method, though; I initially thought of
something *like *
var newEl = document.createElement('newelement')
if(newEl.style.display && newEl.style.display != ''){
meakStyles += 'newEl {display:block;}\r\n'
}
This method doesn't work because element.style.property only returns
author-defined values.
Any ideas?
Regards,
Barney Carroll
barney.carroll at gmail.com
07594 506 381
More information about the thelist
mailing list