img:before { content: "text"; } no longer works [GC]

RESOLVED INVALID

Status

()

defect
RESOLVED INVALID
15 years ago
9 years ago

People

(Reporter: bugzilla, Assigned: dbaron)

Tracking

Trunk
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Reporter

Description

15 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040604 Firefox/0.8.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040604 Firefox/0.8.0+

Using CSS such as img:before {content: "text"; } was working in the Firefox 0.8
release. Using a recent Firefox 0.9 branch build [Mozilla/5.0 (Windows; U;
Windows NT 5.0; en-US; rv:1.7) Gecko/20040604 Firefox/0.8.0+] this CSS no longer
works.

I have been unable to find any mention of this in Bugzilla, but saw the
following post in the forums:

http://forums.mozillazine.org/viewtopic.php?t=69087

Reproducible: Always
Steps to Reproduce:
1. Add the following CSS to a page: img:before { content: "text"; }

Actual Results:  
The text does not appear.

Expected Results:  
The text should appear before all images.

Comment 1

15 years ago
'::before' and/or '::after' don't apply to replaced elements.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → INVALID

Comment 2

15 years ago
Oh yes? Then how did this example creep into the CSS2 specification:
-----
12.2 The 'content' property
(...)
The next rule inserts the text of the HTML "alt" attribute before the image. If
the image is not displayed, the reader will still see the "alt" text.

IMG:before { content: attr(alt) }
-----
In case this was changed in CSS2.1, CSS3 or with an Errata then at least say so.

Comment 3

15 years ago
You should not look in CSS 2.0. It is bogus for quite some parts, especially
that example is really bad. They never really thought about it, I guess.

Comment 4

15 years ago
(In reply to comment #3)
Ok, after looking at 169334 I see the Mozilla crew has decided that the current
implementation is the right one. 
I don't no whether it matters but I think duplicate of bug 169334 would be the
better resolution of this bug: to point people searching bugzilla for an
explanation why that example doesn't work any more in the right direction.
*** Bug 252834 has been marked as a duplicate of this bug. ***

Comment 6

15 years ago
*** Bug 257934 has been marked as a duplicate of this bug. ***

Updated

15 years ago
Summary: img:before { content: "text"; } no longer works → img:before { content: "text"; } no longer works [GC]

Comment 7

15 years ago
*** Bug 259770 has been marked as a duplicate of this bug. ***

Comment 8

14 years ago
*** Bug 292849 has been marked as a duplicate of this bug. ***

Comment 9

14 years ago
*** Bug 319849 has been marked as a duplicate of this bug. ***

Updated

13 years ago
Duplicate of this bug: 365235
Duplicate of this bug: 385767

Updated

11 years ago
Duplicate of this bug: 436283

Updated

10 years ago
Duplicate of this bug: 510209
Duplicate of this bug: 532985
Duplicate of this bug: 582212
You need to log in before you can comment on or make changes to this bug.