Closed
Bug 550096
Opened 16 years ago
Closed 16 years ago
CSS Selector Selecting Element Within Pseudo-Class Doesn't Work.
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
INVALID
People
(Reporter: brille1, Unassigned)
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2) Gecko/20100115 Firefox/3.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2) Gecko/20100115 Firefox/3.6
It seems impossible to select an element by a CSS selector that's containing a pseudo-class in its chain.
Please refer to the sample XHTML file.
The CSS selector of special interest in there is "a:hover img". This selector ought to prevent Firefox from underlining the image when the user hovers with the mouse pointer above the image.
Yet, an underline is displayed when the user hovers above the image.
Reproducible: Always
Steps to Reproduce:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test</title>
<style type="text/css">
img
{border-width: 0;
}
a
{text-decoration: none;
}
a:hover
{text-decoration: underline;
}
a:hover img
{text-decoration: none;
}
</style>
</head>
<body>
<div>
<a href="#"><img src="..." alt="" width="32" height="32"/><br/>Test</a>
</div>
</body>
</html>
Actual Results:
An underline is displayed when the user hovers above the image.
Expected Results:
The "a:hover img" selector ought to prevent Firefox from underlining the image when the user hovers with the mouse pointer above the image.
Comment 1•16 years ago
|
||
The underline you see is from the selector 'a:hover' - the <a> wraps around the image. Any standard complaint browser does the same.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → INVALID
Well, Internet Explorer doesn't.
That's exactly what above selector says: It says: Don't underline any image wrapped by a:hover.
So it should not be underlined. According to the standards.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
'text-decoration' isn't an inherited property, so changing it to 'none' on a descendant does nothing. It draws across descendants rather than being inherited by them (like 'background').
However, it just shouldn't underline images whether you specify 'none' on the image or not. (CSS2 used to say that it should, but CSS 2.1 changed recently.)
So this bug report is invalid, but bug 552251 (which will be fixed by bug 403524) will fix your problem.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago → 16 years ago
Component: General → Style System (CSS)
OS: Windows 7 → All
Product: Firefox → Core
QA Contact: general → style-system
Hardware: x86_64 → All
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•