homepage Welcome to WebmasterWorld Guest from 54.196.168.78
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderator: open

CSS Forum

    
Containing text within floated div?
Megalith




msg:3289238
 3:52 am on Mar 22, 2007 (gmt 0)

Subject says it all.

What can I do to make sure that long pieces of text stay within a floated div?

Would it be practical (or even possible) to put a fixed-width table inside the floated div in order to contain text?

Thanks.

 

penders




msg:3289363
 7:57 am on Mar 22, 2007 (gmt 0)

What can I do to make sure that long pieces of text stay within a floated div?

Are you sure that it's not...? Maybe the floated DIV is expanding to fit its contents? Is there a width set on the floated DIV? (Assuming there are spaces in the text for it to word wrap if reqd)

Setek




msg:3289698
 2:25 pm on Mar 22, 2007 (gmt 0)

I think the OP might mean a possible string (say, for instance, a very long URI... anything without spaces or hyphens I think it will happen) that will push past the boundary of the container.

I've come across this problem a couple of times, sometimes the solution isn't really so much a solution as it is a workaround.

Would it be practical (or even possible) to put a fixed-width table inside the floated div in order to contain text?

I don't think that will work for long, unbroken strings.

Sometimes people who quote long lines of code etc. have this problem - they usually just automatically overflow so there's a horizontal scrollbar - or I've known one or two sites where the unbroken string was forcibly broken after a set amount of characters (via PHP.)

Is this your problem, and are those suitable solutions?

Megalith




msg:3290677
 8:15 am on Mar 23, 2007 (gmt 0)

I understand the problem now...I wasn't aware that spaces were required for the text to actually wrap.

I was just typing a long line of complete jibberish with no spaces just to test out the div spacing...I typed out a real sentence, and it wrapped just fine.

Thanks for the responses anyways.

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