| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
hmmm...
Join Date: Jan 2004
Location: Yorkuk
Posts: 2,127
|
Centering a floated div...
I've been trying to get this to work for a while, but with no results. http://www.mistercut.com/test/ferrara/index.html http://www.mistercut.com/test/ferrara/ferrara.css What it does is great: the div only expands when there's enough room for the next float. But ideally I would like it centered on the page too. Any suggestions? I've tried putting it in a container div, but wasn't sure what styles might make it work. |
|
|
|
|
|
#4 (permalink) |
|
trouble free and loverlee
Join Date: Mar 2003
Location: YooKay
Posts: 2,933
|
Code:
Without a width the container div will simply use its default width which is 100% of its parent element, in this case, the html/window. The width of the container needs to be less than that of the window as you can't center something that already fills the available space. |
|
|
|
#6 (permalink) | ||
|
trouble free and loverlee
Join Date: Mar 2003
Location: YooKay
Posts: 2,933
|
*ahem* Quote:
Quote:
|
||
|
|
|
#8 (permalink) |
|
hmmm...
Join Date: Jan 2004
Location: Yorkuk
Posts: 2,127
|
Any more for any more? I've simplified it all down at: http://www.mistercut.com/test/floatbox.html Thanks |
|
![]() |