Closed Bug 385767 Opened 18 years ago Closed 18 years ago

CSS img:after selector does not work

Categories

(Firefox :: General, defect)

2.0 Branch
x86
Windows XP
defect
Not set
minor

Tracking

()

RESOLVED DUPLICATE of bug 245633

People

(Reporter: arancaytar.ilyaran, Unassigned)

References

()

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 The :after pseudoclass of the img element cannot be styled with CSS, even though this usually works (eg. with div elements). This pseudoclass is very useful, among other things, for adding an automatic caption to images from the alt attribute - W3C recommends this as an accessibility improvement: http://www.w3.org/TR/WCAG10-CSS-TECHS/#Alt Specifically, this is the code that should result in the image's alt attribute being displayed: img:after { content:attr(alt); } Reproducible: Always Steps to Reproduce: Visit a web page that uses the code mentioned above (the URL is a proof-of-concept example) Actual Results: All styles that apply to img:after are ignored. Expected Results: The caption should show up below the image - in this case in a little box with light gray borders. Compare eg. with Opera (tested with 9.21), where the page renders as intended.
Version: unspecified → 2.0 Branch
The same as bug 245633, not?
Apologies for not testing the trunk earlier; it's been crashing on startup for a few days for me now, although it works now. Unfortunately, the latest trunk shows exactly the same behavior. The image is styled, but the img:after content remains invisible.
That's because this is a duplicate of bug 245633, which is invalid. This is not supposed to be working according to css, I guess.
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → DUPLICATE
Just make it work and get it done; it's been too many years.
You need to log in before you can comment on or make changes to this bug.