[SOLVED] multiple columns, text floats out of area... Best solution?

This is a discussion on "[SOLVED] multiple columns, text floats out of area... Best solution?" within the Web Page Design section. This forum, and the thread "[SOLVED] multiple columns, text floats out of area... Best solution? are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Apr 15th, 2008, 18:51
Junior Member
Join Date: Jan 2008
Location: Birmingham, UK
Age: 27
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] multiple columns, text floats out of area... Best solution?

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: Select all
<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: Select all
* {
    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;
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Apr 15th, 2008, 19:15
Reputable Member
Join Date: Jun 2007
Location: uk
Posts: 459
Thanks: 0
Thanked 0 Times in 0 Posts
Re: multiple columns, text floats out of area... Best solution?

If you add overflow:auto; to your #content in your css

That should allow your brown box to expand as you add your text.

Cheers

Pat
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Apr 15th, 2008, 19:18
Junior Member
Join Date: Jan 2008
Location: Birmingham, UK
Age: 27
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Re: multiple columns, text floats out of area... Best solution?

Pat, you are a true genious!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Apr 16th, 2008, 16:45
Junior Member
Join Date: Jan 2008
Location: Birmingham, UK
Age: 27
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Re: multiple columns, text floats out of area... Best solution?

Whoops, I just realised that it works fine until tested on evil ie6. Any suggestions how to get around it?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Apr 16th, 2008, 17:36
Reputable Member
Join Date: Jun 2007
Location: uk
Posts: 459
Thanks: 0
Thanked 0 Times in 0 Posts
Re: multiple columns, text floats out of area... Best solution?

Try adding height:1% in your #content.

There is a name for this fix but I cant remember the name.

Pat
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Apr 16th, 2008, 18:21
Aso's Avatar
Aso Aso is offline
Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,341
Blog Entries: 2
Thanks: 11
Thanked 49 Times in 46 Posts
Re: multiple columns, text floats out of area... Best solution?

^were you thinking of hasLayout?
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Apr 16th, 2008, 18:33
Reputable Member
Join Date: Jun 2007
Location: uk
Posts: 459
Thanks: 0
Thanked 0 Times in 0 Posts
Re: multiple columns, text floats out of area... Best solution?

Thank you Aso.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Apr 17th, 2008, 12:00
Junior Member
Join Date: Jan 2008
Location: Birmingham, UK
Age: 27
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Re: multiple columns, text floats out of area... Best solution?

Fantastic! It worked perfectly.

I owe you one
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying multiple columns in a combo box 1840dsgn Web Page Design 1 Jan 7th, 2008 04:56
text area geyids Flash & Multimedia Forum 4 May 31st, 2007 12:25
Updating web content from text file...or other solution? dank Web Page Design 4 Mar 16th, 2006 23:25
2 columns of text either side of Flash timmytots Web Page Design 11 Nov 29th, 2005 01:18
Two columns of text next to images csa Web Page Design 6 Nov 27th, 2005 17:21


All times are GMT. The time now is 18:30.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42