homepage Welcome to WebmasterWorld Guest from 54.204.128.190
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
Problems creating a 2 column layout with a border around it.
Problem = There is no border around it.
Perfection




msg:4185662
 2:28 am on Aug 12, 2010 (gmt 0)

I'm trying to create a basic 2 column layout. Content on the left, sidebar on the right.

I am also trying to put a border around the whole thing, but for some reason can't actually make it happen.

This is an example of something similar to my code...



<div style="width:950px; border: 1px solid black;">

<div style="float:left; width:650px;">
content stuff goes here
</div>

<div style="float:right; width:300px;">
sidebar stuff goes here
</div>

</div>



This creates a 2 column layout just like I want, except for one problem. That 1px black border I'm trying to put around it all isn't there.

What simple silly css-fail am I committing here?

Thanks in advance for any help.

 

dreamcatcher




msg:4185794
 5:53 am on Aug 12, 2010 (gmt 0)

Try adding a break after your floats. Also, height:100% for your main div is recommended to keep IE happy.

<div style="width:950px; border: 1px solid black; height:100%">

<div style="float:left; width:650px;">
content stuff goes here
</div>

<div style="float:right; width:300px;">
sidebar stuff goes here
</div>

<br style="clear:both" />

</div>

dc

birdbrain




msg:4185808
 6:28 am on Aug 12, 2010 (gmt 0)

Hi there Perfection,

You may find illumination here...

birdbrain

Perfection




msg:4185909
 11:39 am on Aug 12, 2010 (gmt 0)

Bingo! Thanks guys.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved