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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.