Closed Bug 251850 Opened 20 years ago Closed 20 years ago

Cannot position :before or :after pseudo-elements with CSS "position"-property.

Categories

(Core :: Layout: Positioned, defect)

defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 238072

People

(Reporter: hermandsen, Unassigned)

References

()

Details

(Keywords: testcase)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040707 Firefox/0.9.2
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040707 Firefox/0.9.2

You cannot position a :before or :after pseudo-element with the CSS property
"position", even though it should be possible.
The example-page I made, should give you an impression. I'm trying to position
the :before-element in the top left corner and the :after-element in the bottom
right corner. :before has a red border, and :after has a green border.
In Opera, it seem to work.

Reproducible: Always
Steps to Reproduce:

Actual Results:  
The :before-element was positioned before the element.
The :after-element was positioned after the element.

Expected Results:  
Both the :before and :after-elements should be positioned as any element would
be positioned using for example:
  position: absolute;
  left: 10px;
  top: 3px;
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: testcase
OS: Windows XP → All
Hardware: PC → All
> You cannot position a :before or :after pseudo-element with the CSS property
> "position", even though it should be possible.

It was explicitly impossible in CSS 2.0.

CSS 2.1 changed this, but we haven't had a chance to update the code yet.

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