Closed Bug 109966 Opened 24 years ago Closed 24 years ago

a, a:hover, and a:link hide each other (some kind of conflict ?)

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: mozillazine, Assigned: dbaron)

Details

when you put these 3 CSS rules in the same page, only the first (in the order in which they appear) is applied. the others are ignored.for example :<style type="text/css">a:hover { font-family:Arial;font-size:11px;color:green};a { font-family:Arial;font-size:11px;color:blue};a:link { font-family:Arial;font-size:11px;color:red };</style><a href="what">bar</a> baz<br><a href="ever">foo</a> feh<br>you'll get the hover but not the 2 others. put the "a" rule first and... well, you see...seen on Moz 0.9.5 for Linux and MacOS X, and on Netscape 6.1 for Windows.
my report needs some reformatting... (i submitted it from Omniweb, what a foolish idea i've had !!) here it is : when you put these 3 CSS rules in the same page, only the first (in the order in which they appear) is applied. the others are ignored. for example : <style type="text/css"> a:hover { font-family:Arial;font-size:11px;color:green}; a { font-family:Arial;font-size:11px;color:blue}; a:link { font-family:Arial;font-size:11px;color:red }; </style> <a href="what">bar</a> baz<br> <a href="ever">foo</a> feh<br> you'll get the hover but not the 2 others. put the "a" rule first and... well, you see... seen on Moz 0.9.5 for Linux and MacOS X, and on Netscape 6.1 for Windows.
You're not supposed to put a ';' after the declaration block. According to the rules for handling CSS parsing errors, that means the selectors for the last two rules are "; a" and ": a:link", and we're required to treat them that way.
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
ok, i did not see those trailing semi-colons ! (let me emphasize that it's not my code) and guess what ? IE treats this as valid code and gives the author what he expect... so now it will be very difficult for me to explain the author of that code that Mozilla behaves correctly and IE is wrong... once again, IE loose syntax parsing is giving this damn browser an advantage over Mozilla, in the eye of the average webmaster :-(
PS: it reminds me of open <table>s which rendered as blank pages in Nav4 and not in IE... it was really bad from Nav to do this, even if it was invalid html code. please note that now Mozilla renders those open tables. now i bet a lot of people will put extra semi-colons in their style sheets (because it's common in programming languages to have lines ending with ";" or whatever the reason...) so, maybe it would be wiser that Mozilla ignores those garbage semi-colons as IE does ???? that's just a question i'm asking...
This is actually the first time I've seen this particular bug.
You need to log in before you can comment on or make changes to this bug.