Previous Message
Next Message

Re: [css-d] Layout problems in NS6/Mac

Sent by Eric A. Meyer on 27 January 2002 16:04

At 14:50 -0600 1/27/02, Beto wrote:

>OK, to the point: here's a stripped-down version of a layout I'm developing
>for my site's main page:

    Wow.  That's amazing.  I'm not sure why that's happening, and it 
certainly does seem like a bug.  It can be worked around, I think, 
but shouldn't have to be.  One possibility is to float the first 
"boxcontainter" left, float "box3" to the right, and leave the second 
"boxcontainer" unfloated and set left and right margins to leave 
space for the other columns.
    The other possibility is to NOT float 'box1' and 'box2', since you 
have them wrapped in "boxcontainer" divs that are already being 
floated.  There's no reason at that point to float the sub-DIVs, and 
removing the 'float' declarations on the 'box1' and 'box2' rules gets 
rid of the problem in NS6.x.  I still think the NS6.x behavior is a 
bug but I have to go think about it for a while.  I think it has to 
do with Mozilla getting confused when you float inside floats and 
assuming the floats don't have any width, or something.  I'll dig 
around Bugzilla to see if it's been reported, and if not submit a new 
    I did notice that you have multiple ID attributes with the same 
value (box1 and box2), which isn't allowed in XHTML.  Converting 
these to classes, and adjusting the selectors to match, would be a 
good idea.

>1) I'd wish I could position all that layout centered as a block, but the
>only centering code I know in CSS is for text, as in "text-align:center",
>more simply, the CSS equivalent of <div align="center">, or am I just
>pretending there is something else?

    div#todo {width: 70%; margin: 0 auto;}


    div#todo {width: 70%; margin: 0 15%;}

If you want to specify the 'width' value as a pixel or other length 
measure, you'll have to use the 'auto' margin approach shown first.

>2) is there something that can align elements in a row the way <td
>valign="top"> does in a table, but with CSS?

    'vertical-align: top' when applied to a table cell should have the 
same effect as 'valign="top"' on that same cell.

Eric A. Meyer (, List Somethingorother
"CSS is much too interesting and elegant to be not taken seriously."
   -- Martina Kosloff
Previous Message
Next Message

Message thread: