Reply
Multiple columns, text floats out of area... Best solution?
Old 04-15-2008, 02:55 PM Multiple columns, text floats out of area... Best solution?
Novice Talker

Posts: 7
Name: Al
This is probably very simple but I'm trying to figure the best way to achieve having mulitple columns in a box that automatically expand to the allow for the text in the left and right collumns, they are currently overflowing from the content into the footer.

Basically, the "content_left" & "content_right" text are supposed to be in the brown box with the content text. Do I need to use clearing somewhere?

Is using floats the best way for this? If so, what would happen if I wanted to add more columns?

Any help or advice would be greatly appreciated... Here's my HTML:

Code:
<body>

<div id="wrapper">
    <div id="content">
        <p>content text content text content text content text content text content text content text content text content text content text content text content text content text content text content text content text content text content text content text content text content text content text content text </p>
        <div id="content_left">
        <p>left text left text left text left text left text left text left text left text left text left text left text left text left text left text left text left text left text left text left text left text left text left text left text left text left text left text left text left text left text left text </p>
        </div>
        <div id="content_right">
        <p>right text right text right text right text right text right text right text right text right text right text right text right text right text right text right text right text right text right text right text right text right text right text right text right text right text right text right text </p>
        </div>
    </div>
    
    <div id="footer">
        <p>footer text footer text footer text</p>
    </div>
</div>


</body>
...and the css:

Code:
* {
    margin: 0; 
    padding: 0; 
}


#wrapper {
    margin:0px auto;
    margin-top:25px;
    width:950px;
    position:relative;
    border:none;
}

#content {
    background-color:#663300;
}

#content_left {
    color:red;
    width:45%;
    float:left;
}

#content_right {
    color:blue;
    width:45%;
    float:right;
}

#footer {
    background-color:yellow;
}

Last edited by alfandango : 04-15-2008 at 02:56 PM.
alfandango is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 04-15-2008, 03:06 PM Re: Multiple columns, text floats out of area... Best solution?
LadynRed's Avatar
Super Moderator

Posts: 6,562
Location: Tennessee
If you use floats, you MUST clear the floats, yes. For that layout, looks like the easiest method would be to put a clear:both on #footer.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 04-15-2008, 03:13 PM Re: Multiple columns, text floats out of area... Best solution?
Novice Talker

Posts: 7
Name: Al
that works for the text spilling into the footer, but it seems to separate/remove the left & right text from the content box
alfandango is offline
Reply With Quote
View Public Profile
 
Old 04-15-2008, 03:19 PM Re: Multiple columns, text floats out of area... Best solution?
Novice Talker

Posts: 7
Name: Al
fixed it, just needed to add overflow:auto to #content

Last edited by LadynRed : 04-15-2008 at 06:12 PM.
alfandango is offline
Reply With Quote
View Public Profile
 
Old 04-16-2008, 12:51 PM Re: Multiple columns, text floats out of area... Best solution?
Novice Talker

Posts: 7
Name: Al
whoops, I thought I had it but ie6 still has the same problem. Any suggestions how to get around it?

It works fine in FF & ie7 though
alfandango is offline
Reply With Quote
View Public Profile
 
Old 04-16-2008, 02:21 PM Re: Multiple columns, text floats out of area... Best solution?
LadynRed's Avatar
Super Moderator

Posts: 6,562
Location: Tennessee
Define a width for #content to invoke hasLayout.
I suggest you start reading here: www.positioniseverything.net.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Multiple columns, text floats out of area... Best solution?
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.14087 seconds with 12 queries