Closed Bug 284982 Opened 19 years ago Closed 19 years ago

user agent ignores 'position' 'float' elements in :before and :after pseudo-elements (CSS2->CSS2.1)

Categories

(Core :: Layout: Floats, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 238072

People

(Reporter: seven, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; nl-NL; rv:1.7.6) Gecko/20050223 Firefox/1.0.1
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; nl-NL; rv:1.7.6) Gecko/20050223 Firefox/1.0.1

To quote the page where I found this bug:
"I am working on a site for a client today, and I am trying very hard to
maintain strict seperation of presentation and mark-up. After deciding that I
would like to use the hr element (though I wish I could use section), which I
could easily make pretty in real browsers, but would degrade gracefully into a
simple line in IE. Here's the CSS I whipped up in about two minutes:

hr {
border: 0;
height: 12px;
width: 80%;
background: url(images/hr/line.png);
}

hr::before,
hr::after {
display: block;
height: 12px;
width: 12px;
white-space: pre;
content: " ";
}

hr::before {
float: left;
background: top left no-repeat url(images/hr/left.png);
}

hr::after {
float: right;
background: top right no-repeat url(images/hr/right.png);
}

Which didn't work in Gecko-based (read "Firefox") browsers. After wasting
several hours trying to figure out what was going on, reading (over and over)
the CSS 2.1 recommendation, I finally took a look at it's predacessor, CSS2. I
quickly found the problem. There, in all its malevolent splendor, was the single
most violoently moronic and offensively ill-conceived sentence I have ever seen;
User agents must ignore the following properties with :before and :after
pseudo-elements: 'position', 'float', list properties, and table properties. (§
12.1)

Oh, CSS 2.1 corrects the problem, but it seems Gecko hasn't quite caught on. The
CSS 2 specification was riddled with bugs, and it seems that even modern
browsers have yet to escape the wrath of its idiocy."

Reproducible: Always

*** This bug has been marked as a duplicate of 238072 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.