Closed Bug 308509 Opened 19 years ago Closed 19 years ago

CSS center no longer centers to screen height

Categories

(Firefox :: General, defect)

1.5.0.x Branch
x86
Windows XP
defect
Not set
minor

Tracking

()

RESOLVED DUPLICATE of bug 243751

People

(Reporter: bryan, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6

I used the following code to set up a generic splash screen for their website:

<style type="text/css" >
body
{
background: #FBF7DF url(secrecy.jpg) no-repeat center;
}
</style>
<body></body>

In Firefox 1.0.x, it will display the image on the center of the screen based on
the height and width of the screen, but if I try to view the same page in 1.5x,
it only centers it based on the width of the screen, not the height, so the
image ends up being centered on the very top of the browser page.

Reproducible: Always

Steps to Reproduce:
1. Go to webpage, www.totalsecrecy.com, in Firefox 1.5 to see the problem.

Actual Results:  
The image ends up being centered on the very top of the browser page.

Expected Results:  
The image should be centered on the page based on the width and the height of
the browser. This seems to work ok in versions prior to 1.5.
Version: unspecified → 1.5 Branch

*** This bug has been marked as a duplicate of 243751 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
Another site.
I use css centralizer property "center center".
As the friend told, it only obeys in the horizontal, not the vertical.
Although we program to be at the vertical center it goes ABOVE the top.

See it at www.sitesbr.net/www/amorpositivo/bemvindo.asp

<body class="musgo"  background="corestil_def.jpg"
style='background-repeat:no-repeat; background-position:center center'
onload='setup()'>

Firefox 1.0.6 displayed the background correctly.

Another problem:
the website www.estadao.com.br has different appearances between 1.0.6 and 1.5
1.5 makes the menu look wrong while 1.0.6 showed it right.

What has been done in 1.5 css rendering? Why those bugs?
I think you should not make it official before these problems are fixed...
(In reply to comment #2)
> What has been done in 1.5 css rendering? Why those bugs?
> I think you should not make it official before these problems are fixed...
> 

It's not a bug - please read the CSS 2.1 spec to confirm that fact.
According to the spec, you must set a height on the root element of the
document. See the comments in bug 243751 for more details.
Well your solution work, but some points are:

1- Why Firefox 1.0.6 didn't have problems showing in the correct position? Now
we HAVE ONE MORE THING TO ADD to all style properties in order to work.
Setting the position property to "center center" shouldn't do this?

2- So, every site to look OK will have to be REWRITTEN to have "height:100%" ??
So every change in css specification we will have to REWRITE all sites? It
doesn't seem strange? OK css evolves, but I think it should keep compatible with
previous ones or not?

3- So it was a change in css especs not a Firefox bug. After all, is Firefox
1.0.6 better or worse than Firefox 1.5 Beta dealing with css? I think 1.0.6
never gave us problems (ex. to have do add things to css...)

Thanks for all
You need to log in before you can comment on or make changes to this bug.