Closed
Bug 308380
Opened 19 years ago
Closed 19 years ago
CSS Property "background-position" displays incorrectly for vertical alignments that use "center" or a percentage
Categories
(Firefox :: General, defect)
Tracking
()
VERIFIED
DUPLICATE
of bug 243751
People
(Reporter: toadking, Unassigned)
References
()
Details
(Keywords: testcase)
Attachments
(1 file)
|
246 bytes,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20050913 Firefox/1.6a1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20050913 Firefox/1.6a1 When you set a vertical position for a background image, such as "top center" or "5em 25%", the image appears half cut off at the top of the page and only negative percent values lower it. Reproducible: Always Actual Results: The top half of the background image is cut off at the top of the page. Expected Results: The background image should appear in the center of the page horizontally AND vertically. http://toadking.ath.cx/background-position.html Before the Deer Park Alpha releases, I found this to not be a problem. I was going for the Beta release since I was suspecting it was an obvious bug that would be found quickly. I guess I was wrong. Since it works okay in 1.0.6 or earlier versions, I'm pretty sure it has something to do with a change in the way it handles that CSS property. I would love to help fix it, but the only non-web programming language I know is Java, which Firefox isn't coded in.
| Reporter | ||
Updated•19 years ago
|
Version: unspecified → Trunk
Comment 2•19 years ago
|
||
This is actually exactly what is supposed to happen. According to the spec[1], when you specify just "center", it is the same as "50% 50%". This would place the pixel 50% from the left and 50% from the top of the image at the spot 50% across and 50% down the <body> padding area. If you want to fix this, specify "top center" or an equivalent. Resolving INVALID. [1] http://www.w3.org/TR/CSS21/colors.html#propdef-background-position
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
Comment 3•19 years ago
|
||
Actually, I think that current trunk builds are doing it correct here. Look at the height of the body element in the dom inspector. It has only a very small height. The background-image is exactly centered vertically in that box. Opera8 is doing the same.
Keywords: testcase
Updated•19 years ago
|
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Comment 4•19 years ago
|
||
*** This bug has been marked as a duplicate of 243751 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago → 19 years ago
Resolution: --- → DUPLICATE
Updated•19 years ago
|
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•