Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



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

Posts: 7
Name: Al
Trades: 0
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 03:56 PM..
alfandango is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-15-2008, 04:06 PM Re: Multiple columns, text floats out of area... Best solution?
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
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 !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 04-15-2008, 04:13 PM Re: Multiple columns, text floats out of area... Best solution?
Novice Talker

Posts: 7
Name: Al
Trades: 0
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, 04:19 PM Re: Multiple columns, text floats out of area... Best solution?
Novice Talker

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

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

Posts: 7
Name: Al
Trades: 0
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, 03:21 PM Re: Multiple columns, text floats out of area... Best solution?
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
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 !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Multiple columns, text floats out of area... Best solution?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.17183 seconds with 12 queries