Moon
Moon

Reputation: 20032

CSS: Div Positioning... help

take a look at this Code. i want the Left & Right Box (DIVs) to appear in one line.. how to do it

Upvotes: 0

Views: 108

Answers (2)

CuriousCurmudgeon
CuriousCurmudgeon

Reputation: 396

Float both the left and right divs to the left and clear the footer. You will also need to adjust the widths of the left and right divs for them to fit on the same line.

#left
{
    position:static;
    width: 40%;
    height: 50px;
    margin-top: 10px;
    margin-right: 10px;
    background: #111111;
    border: solid 3px #ff0000; 
    float: left;
}

#right
{
    position:static;
    width: 40%;
    height: 50px;
    margin-top: 10px;
    margin-right: 10px;
    background: #111111;
    border: solid 3px #ff0000;
    float: left;
}

#footer
{
    position: static;
    width   : 100%;
    height  : 50px;
    margin-top: 10px;

    background: #111111;
    border: solid 3px #ff0000;
    text-align: center;
    clear: both;
}

Upvotes: 0

Brandon Frohbieter
Brandon Frohbieter

Reputation: 18139

<div><div style="float:left">a</div> <div style="float:left">b</div></div>
<div style="clear:both"></div>

Upvotes: 1

Related Questions