Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: On CSS and other machinations.

by joe++ (Friar)
on Oct 21, 2002 at 15:58 UTC ( #206868=note: print w/replies, xml ) Need Help??

in reply to On CSS and other machinations.

Hi barrd,

Regarding your css example, I did a quick test with two recent builds of Mozilla (Build 2002091208/WinNT, 2002100104/Linux). A <div class="test_underscore"> was perfectly stylable through css.

Looking some more at the Perlmonks code, I noticed that both th.nodelet_head and tr.nodelet_head are used. Specifying a generic class ".nodelet_head" doesn't work, as it is less specific than the original style specificatuions. Playing with Mozilla's DOM inspector is very helpful to debug CSS issues like this.

My solution is simple (for Mozilla at least): add the "!important" qualifier to your styles, this will override more specific but "unimportant" styles.

.nodelet_head { font-weight: bold !important; color: #ff9933 !important; background-color: #990000 !important; }
This Works For MeTM.

On a side note, there is no mention of "css" connected with "underscore" to be found in Bugzilla - so I don't think this is a bug, at least not with current builds.

Update: Fixed a typo ;-(

Update 2: Apparently, from the CSS level 2 syntax specification I seem to conclude that the underscore in style identifiers indeed is illegal. Still, this works just fine for IE 5.x+ and Netscape 6+ (Mozilla) in production code on the site I'm maintaining as well. Hmm, maybe I should fix that one day...

Cheers, Joe

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://206868]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2021-02-27 04:30 GMT
Find Nodes?
    Voting Booth?

    No recent polls found