Closed Bug 80506 Opened 24 years ago Closed 24 years ago

Mozilla isn't centering objects correctly even told so

Categories

(Core :: Layout, defect)

x86
Windows 98
defect
Not set
normal

Tracking

()

VERIFIED INVALID

People

(Reporter: boro, Assigned: karnaze)

References

()

Details

Go to http://htklx2.htk.fi The page itself you see should be center as told in source: <div style="text-align:center" class="centered"> But table stays uncentered. IE shows the page correctly. Some problem can be seen on page http://htklx2.htk.fi/users.php
The <div> contains no text to center. You cannot center a block/table with text-align. Use style="margin-left:auto; margin-right:auto" instead. INVALID.
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
Didn't work. More ideas?
Forgot to say, you need a width specified for this to work. I.e., set a width on the <div> or set the margins on the <table>. Another method would be to keep "text-align:center" and make the table inline by setting style="display:inline-table" on the table. However, this is not implemented yet (bug 18217).
And note: "width:600" is invalid CSS. You need to say "width:600px".
Aha, okay. Thanks a lot. So IE is just showing tables inline even not told so :-P I used TopStyle Pro to create stylesheets, it didn't told me anything about setting px there too. Even, what else format that could be? inches? centimeter? ;-)
Hmm I found another problem. Now the page is centered with those margin-left and margin-right -things, the blue footer-block doesn't get centered correctly. It's one pixel too much right (IE shows correctly...).
> I used TopStyle Pro to create stylesheets, it didn't told me anything about > setting px there too. Even, what else format that could be? inches? centimeter? The spec is here: http://www.w3.org/TR/REC-CSS2 You can validate your CSS here: http://jigsaw.w3.org/css-validator/ > Hmm I found another problem. Now the page is centered with those margin-left and > margin-right -things, the blue footer-block doesn't get centered correctly. It's > one pixel too much right (IE shows correctly...). No, IE does it wrong (supposed to be fixed in IE 6.0 with some DOCTYPEs). "width:100%" does not include borders. Use "width:auto".
Hmm, ignore my last comment, there are no borders...
Because the center table is 600 pixels wide + 2 pixels (border on right and left) and footer is 602 pixels wide, no borders, shouldn't they get aligned straight like IE shows them?
Footer seems to be 602px + 2*2px padding.
I changed cellpadding=2 to cellpadding=0, still same problem. Also added all missing px'es, but nothing.
verifying INVALID Pauli, you might wanna read: http://www.w3.org/TR/REC-CSS2/box.html as well as: http://www.w3.org/TR/REC-CSS2/tables.html
Status: RESOLVED → VERIFIED
Okay, I got it now <g>. Quite weird stuff. I've always thought that IF Explorer shows page - it shows it correctly. It seems like you can't compare and think that "this browser does it right" :-) And I prefer thinking that IE would show pages more correctly than Mozilla with it all bugs... but anyway, thanks guys!
You need to log in before you can comment on or make changes to this bug.