RE: [WSG] centering floats?

2005-03-11 Thread Martin J. Lambert
Alan Trick wrote:
 Centering the containiner is meaningless though if it doesn't have a
 fixed width (that's smaller than it's container), and if it does have
 a fixed width, than it ruins the whole point of the thing, to allow
 the boxes to flow depending on the size of the container.
 
 David Laakso wrote:
 You could center the container holding the floats using  margin auto;
 however, you would not be able to center the floats within that
 container-- it's pick your poison, either float them left, or float
 them  right.


You could let JavaScript handle it. As soon as the page loads, check
where the rightmost float falls and adjust the width of the (centered)
container accordingly. If the user doesn't have JavaScript, they'll
still get the left-floated version that you're settling for anyway.


Martin Lambert
[EMAIL PROTECTED]

**
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list  getting help
**



[WSG] centering floats?

2005-03-10 Thread Alan Trick
I have a bunch of boxes that are all a fixed width and a fixed height.  
I have them floated in a containiner so that they lineup nicely into 
rows. However, I want them centered so that when I only have one or two 
they'll be, well, in the center. There's no float:center as far as I 
know, but is there some other way to achive this?  I can't make them 
inline elements because then i'll lose the fixed height and width, and 
if I make them display:block then they won't line up in the rows.
Alan Trick
**
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list  getting help
**


Re: [WSG] centering floats?

2005-03-10 Thread David Laakso
On Thu, 10 Mar 2005 14:44:39 -0500, Alan Trick [EMAIL PROTECTED]  
wrote:

I have a bunch of boxes that are all a fixed width and a fixed height.   
I have them floated in a container so that they lineup nicely into rows.  
However, I want them centered so that when I only have one or two  
they'll be, well, in the center. There's no float:center as far as I  
know, but is there some other way to archive this?  I can't make them  
inline elements because then i'll lose the fixed height and width, and  
if I make them display:block then they won't line up in the rows.
Alan Trick
You could center the container holding the floats using  margin auto;  
however, you would not be able to center the floats within that  
container-- it's pick your poison, either float them left, or float them  
right.
Best,
~david


--
de gustibus non est disputandum
http://www.dlaakso.com/
**
The discussion list for  http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list  getting help
**


Re: [WSG] centering floats?

2005-03-10 Thread Alan Trick
Centering the containiner is meaningless though if it doesn't have a 
fixed width (that's smaller than it's container), and if it does have a 
fixed width, than it ruins the whole point of the thing, to allow the 
boxes to flow depending on the size of the container. 

I guess i'll just have to float to the left.
David Laakso wrote:
On Thu, 10 Mar 2005 14:44:39 -0500, Alan Trick 
[EMAIL PROTECTED]  wrote:

I have a bunch of boxes that are all a fixed width and a fixed 
height.   I have them floated in a container so that they lineup 
nicely into rows.  However, I want them centered so that when I only 
have one or two  they'll be, well, in the center. There's no 
float:center as far as I  know, but is there some other way to 
archive this?  I can't make them  inline elements because then i'll 
lose the fixed height and width, and  if I make them display:block 
then they won't line up in the rows.
Alan Trick
You could center the container holding the floats using  margin auto;  
however, you would not be able to center the floats within that  
container-- it's pick your poison, either float them left, or float 
them  right.
Best,
~david


**
The discussion list for  http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list  getting help
**