Closed
Bug 261727
Opened 21 years ago
Closed 21 years ago
Anchor pseudo-classes for images, combined with normal class don't work properly
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: stakadush, Assigned: bugzilla)
Details
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8a4) Gecko/20040926 Firefox/0.9.1+
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8a4) Gecko/20040926 Firefox/0.9.1+
there seems to be a problem with anchor clasess for images, when combined with
normal classes.
for example, if you try to attach this definition to an image it won't work:
.thumbStyle, a.thumbStyle:link, a.thumbStyle:visited {
border:1px;
border-color: #000000;
border-style: solid;
}
a.thumbStyle:hover, a.thumbStyle:active {
border:1px;
border-color: #ffff66;
border-style: solid;
}
<img src="images/some_image.jpg" class="thumbStyle">
i had to seperate the class (.thumbStyle) from the anchor definition as follows,
to make it work:
.thumbStyle, a:link .thumbStyle, a:visited .thumbStyle {
border:1px;
border-color: #000000;
border-style: solid;
}
a:hover .thumbStyle, a:active .thumbStyle {
border:1px;
border-color: #ffff66;
border-style: solid;
}
<img src="images/some_image.jpg" class="thumbStyle">
i am not a stlye sheets genious, but from what i understand reading,
http://www.w3.org/TR/REC-CSS1#anchor-pseudo-classes, the first example is legal,
whereas the second is not.
by the way, the first example works great on other elements (div, td, tr...),
and the second doesn't work at all! :)
Reproducible: Always
Steps to Reproduce:
1. create a document with the stylesheets
2. see the difference ;)
3.
Actual Results:
images didnot respond to the first style sheet example at all, but to the second
one.
Expected Results:
images should have respond to the first style sheets example, instead of the
second one.
Comment 1•21 years ago
|
||
Assuming you mean that there's an <A> tag around the IMG, this is invalid.
You've put the class name on the IMG tag, but your first example has the class
name on the A tag, so it gets ignored.
In the second example, your styles say to put the styles on anything of that
class that's within an A tag, so it works.
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•