Jump to content

CSS Question


carlg

Recommended Posts

Let's say I have a div section and the size is 800width x 400 height.

 

Now I have 2 other div sections that are each 400x400.

 

I want to place them inside of the 800x400 div so they are right along side of each other.

 

How can I do this?

 

Everytime I try this, it places the second section underneath the first one and not along side of it

 

Here is some sample code

 

.outerbox{
     width:800;
     height:400;
}

.sec1{
     width:400;
     height:400;
}

.sec2 {
     width:400;
     height:400;
}

 

 

and here is some sample html

 

<div class="outerbox">
<div class="sec1">content of 1</div>
<div class="sec2">content of 2</div>
</div>

 

 

so why does section 1 appear below section 2 and not to the right of section 2 to fill up it's outer container?

 

How can I make section 2 appear to the right of section 2.

 

I know this can be done with absolute and relative positioning, but I'm trying to think of a different way because the positioning sometimes works differently in different browsers.

 

Thanks for the help!!!

Link to comment
https://forums.phpfreaks.com/topic/69330-css-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.