Lining Up Div's

Discussion in 'Web Design and Development' started by monke, Nov 5, 2006.

  1. monke macrumors 65816

    monke

    Joined:
    May 30, 2005
    #1
    Here's what I have for coding so far:

    Page:
    Code:
    <div id="div1">
    	<div id="div2"></div>
    	<div id="div3"></div>
    </div>
    CSS Document:
    Code:
    #div1 {
    	height: 428px;
    	width: 752px;
    	margin-top: 36px;
    	margin-left: auto;
    	margin-right: auto;
    }
    #div2 {
    	height: 428px;
    	width: 319px;
    }
    #div3 {
    	height: 428px;
    	width: 319px;
    }
    Is there a way to line up div's #2 and #3 beside each other?
    Like this horrible drawing I have made :p : Div Line Up.jpg
    Or would I have to use tables in order to do it?

    Thanks
     
  2. nightelf macrumors 6502

    Joined:
    Mar 25, 2003
    #2
    I'm not very good at CSS positioning, etc but I think you can do something like this

    <div class="1">
    <div class="3"></div>
    <div class="2"></div>
    </div>

    and have div.3 float to the right.

    I usually use tables for structure and css for presentation.
     
  3. monke thread starter macrumors 65816

    monke

    Joined:
    May 30, 2005
    #3
    Yes, thanks once again nightelf, that's the only speed bump I've hit in a while. Finally I'm starting to get used to this CSS stuff. :)
     

Share This Page