Page 1 of 1

css layout

Posted: Tue Apr 10, 2007 7:27 am
by malcolmboston
i have 2 divs that looks like the following

Code: Select all

[----------------------] [-------------------------------------------------]
[                           ] [                                                              ]
[                           ] [                                                              ]
[                           ] [                                                              ]
[                           ] [                                                              ]
[                           ] [                                                              ]
[                           ] [                                                              ]
[                           ] [                                                              ]
[                           ] [                                                              ]
[                           ] [                                                              ]
[______________] [                                                             ]
                              [                                                              ]
                              [                                                              ]
                              [                                                              ]
                              [                                                              ]
                              [                                                              ]
                              [                                                              ]
                              [_______________________________]
i want them both to have the same height, im using the code something like

Code: Select all

<div style="float: left;">&nbsp;</div>
<div style="float: left;">&nbsp;</div>
how can i get them both to stretch to the same height as 99% of the time the right box is much longer than the left box

edit: the image looked right when editing in FF :S

Posted: Tue Apr 10, 2007 9:02 am
by Oren
Do you really need them in the same height or just to look as they are the same height? (I hope you know what I mean)

If you just want them to look as they are the same height, put both of them in a container DIV and use the appropriate background image to make it look as they were the same height - this is a pretty common technique.

Posted: Tue Apr 10, 2007 9:08 am
by Chris Corbyn
Search for "faux columns". People use background images to create an illusion.

http://www.alistapart.com/articles/fauxcolumns/

Posted: Tue Apr 10, 2007 9:40 am
by JayBird
Ill third that...faux columns is the way to go