Closed
Bug 80506
Opened 24 years ago
Closed 24 years ago
Mozilla isn't centering objects correctly even told so
Categories
(Core :: Layout, defect)
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
Comment 1•24 years ago
|
||
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
| Reporter | ||
Comment 2•24 years ago
|
||
Didn't work. More ideas?
Comment 3•24 years ago
|
||
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).
Comment 4•24 years ago
|
||
And note: "width:600" is invalid CSS. You need to say "width:600px".
| Reporter | ||
Comment 5•24 years ago
|
||
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?
;-)
| Reporter | ||
Comment 6•24 years ago
|
||
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...).
Comment 7•24 years ago
|
||
> 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".
Comment 8•24 years ago
|
||
Hmm, ignore my last comment, there are no borders...
| Reporter | ||
Comment 9•24 years ago
|
||
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?
Comment 10•24 years ago
|
||
Footer seems to be 602px + 2*2px padding.
| Reporter | ||
Comment 11•24 years ago
|
||
I changed cellpadding=2 to cellpadding=0, still same problem. Also added all
missing px'es, but nothing.
Comment 12•24 years ago
|
||
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
| Reporter | ||
Comment 13•24 years ago
|
||
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.
Description
•