Getting divs to stay on one line?

Discussion in 'HTML & Website Design' started by Brandon the Great, Feb 13, 2009.

  1. #1
    How do you get two divs to stay on one line?
     
    Brandon the Great, Feb 13, 2009 IP
  2. dylanmills

    dylanmills Peon

    Messages:
    50
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You could use CSS to set the display style of the divs to inline or float both divs.
     
    dylanmills, Feb 13, 2009 IP
  3. Brandon the Great

    Brandon the Great Banned

    Messages:
    170
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Thank you!
     
    Brandon the Great, Feb 13, 2009 IP
  4. Noc

    Noc Active Member

    Messages:
    485
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #4
    Would spans work?
     
    Noc, Feb 13, 2009 IP
  5. justinlorder

    justinlorder Peon

    Messages:
    4,160
    Likes Received:
    61
    Best Answers:
    0
    Trophy Points:
    0
    #5
    <div id="container">
    <div id="left">
    </div>
    <div id="right">
    </div>
    </div>

    #container {width:1024px}
    #left {width:300px; float:left}
    #right {width:724px; float:left}

    That is all . First step is set the width of the DIVs, second step is set two DIVs float property.
     
    justinlorder, Feb 13, 2009 IP