Closed
Bug 296408
Opened 20 years ago
Closed 20 years ago
CSS Class styles with a hover effect such as .test:hover {} fail on a div.
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: Lhunath, Assigned: dbaron)
References
()
Details
User-Agent: Opera/8.0 (X11; Linux i686; U; en)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050530
.test:hover { background: red; }
<div class="test">Testing div</div>
Will not become red on Hover.
However, when we change .test:hover into div.test:hover; it does work!
Reproducible: Always
Steps to Reproduce:
1. Have a .classname:hover {} style
2. Hover the element in question
3. No hover effects are applied
Actual Results:
No hover effects are applied
Expected Results:
The specified CSS rules should be applied (in the example, the div should
receive a red background).
Comment 1•20 years ago
|
||
URL http://www.lyndir.com/bugs/two.html does not work for me.
Comment 2•20 years ago
|
||
Sounds like bug 169078.
See also http://www.mozilla.org/docs/web-developer/quirks/quirklist.html
The URL suffers resolution problems, it's basically exactly the same as the
example I provided.
Updated•20 years ago
|
Assignee: general → dbaron
Component: General → Style System (CSS)
Product: Mozilla Application Suite → Core
QA Contact: general → ian
Version: unspecified → Trunk
Updated•20 years ago
|
Version: Trunk → 1.7 Branch
Comment 4•20 years ago
|
||
comment 2 is correct. the document at the URL has no doctype declaration.
adding a proper doctype declaration to the page at the URL fixed it.
resolving INVALID -- the rendering is as intended.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Hold on, you're saying you're not going to fix it; because it's operating in
Quirks Mode? Or are you really saying in Quirks Mode, div.class and .class
applied on a div, are two different things...?
Comment 6•20 years ago
|
||
It is intentional that :hover doesn't work on <div>s in quirks mode, for
compatibility with the many (many!) sites written for IE that depend on this.
In theory, that evil behaviour is mostly of Mozilla's doing. Should a
webdesigner bother to write a :hover on a DIV in the first place, it means he's
got a good browser to test it with, or a good browser he's targetting. The only
way we could assume the designer thinks is:
"IE doesn't support hover, so it's ok to make hovers on a DIV where to might
screw up IE compatibility; since the Mozilla -being compatible with IE- ignores
it too. So I don't need to make sure my things are Standardised, Mozilla'll make
my site work anyway."
In a way it's good I suppose; for all the Mozilla users who can't stand seeing a
site different than in IE.
Comment 8•20 years ago
|
||
Unfortunately no. People put :hover rules on all elements and expect them to
only apply to links, and when they see it applying to all elements (and
underlining massive blocks of text, e.g.) they blame us.
You've a point there, seen that happen in Opera (which does allow for :hover in
Quirks).
Sad how society is always ruled by the most stupid amoungst it =)
You need to log in
before you can comment on or make changes to this bug.
Description
•