Closed
Bug 326247
Opened 19 years ago
Closed 18 years ago
center center for background does not work in body tag
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: darasu, Unassigned)
References
()
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1
If you specify background-position as "center center" the background image is not center vertically and horizontally in the viewport as it has in previous versions of Mozilla. A workaround is to add the following rule: html {height:100%;}.
Reproducible: Always
Steps to Reproduce:
1. Create this rule: body {background:url(someimage.jpg) center center no-repeat;}
2. View page in browser.
Actual Results:
The background image is horizontally centered but vertically it is pushed off the top of the page.
Expected Results:
The background image should be vertically and horizontally centered on the page.
This is not a bug, but the desired behaviour. The html element has no height, there being nothing in it in your example, so the image is properly centered in the viewport at the top of the page. If html had one line, the image would be centered in the viewport over that one line (etc).
You've already discovered the correct solution :).
This is explained in this bug --> https://bugzilla.mozilla.org/show_bug.cgi?id=243751#c6
Note that Opera properly follows the same behaviour as mozilla.
Comment 2•18 years ago
|
||
--> INVALID
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → INVALID
Version: unspecified → 1.5.0.x Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•