![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a series of blocks that are float left that I need centered on the page. div class="center" align="center" div style="width: 100 px;float: left">thumbnail 1</div div style="width: 100 px;float: left">thumbnail 2</div div style="width: 100 px;float: left">thumbnail 3</div /div None of these work: .center{margin: auto} .center{text-align: center} How do I center the class center div? |
#3
| |||
| |||
|
|
Jeff Thies wrote: I have a series of blocks that are float left that I need centered on the page. div class="center" align="center" div style="width: 100 px;float: left">thumbnail 1</div div style="width: 100 px;float: left">thumbnail 2</div div style="width: 100 px;float: left">thumbnail 3</div /div None of these work: .center{margin: auto} .center{text-align: center} How do I center the class center div? You need to specify a width on that center div :-) IIRC (anyone, please correct me if I'm wrong) the text-align: center is needed for IE5, while the margin:auto is there for the newer browsers. |
#4
| |||
| |||
|
|
IIRC (anyone, please correct me if I'm wrong) the text-align: center is needed for IE5, while the margin:auto is there for the newer browsers. |
#5
| |||
| |||
|
|
Els wrote: IIRC (anyone, please correct me if I'm wrong) the text-align: center is needed for IE5, while the margin:auto is there for the newer browsers. |
|
margin: auto is used to center block level elements themselves. http://www.w3.org/TR/CSS1#horizontal-formatting |
#6
| |||
| |||
|
|
On Sat, Sep 13, Nikolaos Giannopoulos inscribed on the eternal scroll: Els wrote: IIRC (anyone, please correct me if I'm wrong) the text-align: center is needed for IE5, while the margin:auto is there for the newer browsers. You're relying on a bug in MSIE to compensate for another bug, but yes, that's pretty much it, except that normally you'd want to negate |
#7
| |||
| |||
|
|
On Sat, Sep 13, Nikolaos Giannopoulos inscribed on the eternal scroll: Els wrote: IIRC (anyone, please correct me if I'm wrong) the text-align: center is needed for IE5, while the margin:auto is there for the newer browsers. You're relying on a bug in MSIE to compensate for another bug, but yes, that's pretty much it, except that normally you'd want to negate the text-centering effect inside of whatever block element it is that you're centering, otherwise all your content would get centered. |
|
For more detailed discussion I'd suggest http://www.allmyfaqs.com/cgi-bin/wik...enter_with_CSS Google also found this treatise on the topic: http://theodorakis.net/blockcenter.html |
|
margin: auto is used to center block level elements themselves. http://www.w3.org/TR/CSS1#horizontal-formatting In theory, yes, but that only works on conforming WWW browsers. |
#8
| |||
| |||
|
|
In re-reading Els reply I realize that he made ..... That [his remark ..... his statement ..... |
#9
| |||
| |||
|
|
I knew it was a bug, but didn't realise the workaround was relying on yet another bug :-( |
#10
| |||
| |||
|
|
Els wrote: I'm not a 'he'.... ;-) Sorry ;-) |
![]() |
| Thread Tools | |
| Display Modes | |
| |