/    Sign up×
Community /Pin to ProfileBookmark

hey, I want to set it so that if some text is too wide for its container, I want it to wrap around to the next line. I dont see any way to do this with css tho.

to post a comment
CSS

17 Comments(s)

Copy linkTweet thisAlerts:
@CentauriSep 24.2007 — That is the normal default unless you specify otherwise.
Copy linkTweet thisAlerts:
@michael879authorSep 24.2007 — no its not. Normally the text just pops out of the <div> container if I dont put a newline.
Copy linkTweet thisAlerts:
@CentauriSep 24.2007 — Then you probably have some absolute positioning set - post the code being used, or a link to a site.
Copy linkTweet thisAlerts:
@WebJoelSep 24.2007 — Something's not right... -do you have a line like "overflow:visible;" or something like that? IE would incorrectly expand the container to accomodate the 'overflow' length, while a compliant browser would merely allow the text to literally 'overflow' over the edge of the container... And, there sounds as if there might also be "position:absolute;" involved but even then, the default nature of text content is to 'wrap', unless you are not providing "whitespace"...

thatistosaythatyoudidnotprovideanyspacebetweenyoursampletextwords,nowhite-space,no-wrap...

(The above is a perfect example: IE would incorrectly expand the container beyond the stated width, and Firefox would correctly (and make it ugly), let the text protrude over the edge of the container...
Copy linkTweet thisAlerts:
@ZnupiSep 24.2007 — I've been wondering about this for a while but didn't care to ask... Is there no way to make continuoustextlikethisone wrap, using css?
Copy linkTweet thisAlerts:
@michael879authorSep 24.2007 — ok yea my bad, the container was positioned absolutely. Is there still a way to wrap the text inside it? Also, there is whitespace, and Im using firefox.
Copy linkTweet thisAlerts:
@michael879authorSep 24.2007 — also heres the link to an example:

http://www.walking-city.com/launchit/www/business.php?type=1

unfortunatly either my memory is wrong or I changed something because I cant reproduce the problem I was having. Now, it only doesn't wrap when theres no white space. However, like znupi asked earlier, is there a way to wrap text with no whitespace (in css)? I could do it with php but Id rather keep styling stuff out of the php.
Copy linkTweet thisAlerts:
@ray326Sep 24.2007 — Actually it's not style, it's content and server side is a perfectly good place to do content manipulation. There's nothing in standard CSS to force breaking up words.
Copy linkTweet thisAlerts:
@michael879authorSep 24.2007 — it is style, at least in my case. The container size is set in my stylesheet. If I decide to make the container bigger, I dont want to have to go into the php and edit when to breakup words. Id want to just swap the stylesheet for a new one and have it work. What your suggesting wouldnt work like that.
Copy linkTweet thisAlerts:
@WebJoelSep 24.2007 — I'm gettng a 'stack overflow at Line 37' error when viewing this in IE... anyone else see that also? Line 37 is where "[B]<body onload='onload()'>[/B]" is. -That is a hardware interupt as I recall. -Used to get a ton of these errors (followed immediately by BSOD) when using Win-95 with minimal RAM when viewing excessively-nested TABLE builds... Not sure what tripped this event here..
Copy linkTweet thisAlerts:
@michael879authorSep 24.2007 — did you post that in the right thread...? Anyway, based on no code, Id guess that your problem is in the onload() function. probly an infinite loop or something. stack overflow means you filled up your stack.
Copy linkTweet thisAlerts:
@ray326Sep 25.2007 — It's a Javascript VM stack overflow due to <body onload='onload()'>. It's in the page you linked to, Michael.
Copy linkTweet thisAlerts:
@michael879authorSep 25.2007 — o haha. oops :p. I dont get that error... are you guys using IE or something? I dont have an onload function defined. I was under the impression if there wasnt one defined it would just ignore it. It does in firefox at least.. Anyway it doesnt matter the example got deleted when I had to reinstall my database tables.
Copy linkTweet thisAlerts:
@ray326Sep 25.2007 — All those on*() things are functions that generally do nothing but return. When you assign your own function it replaces them. In this case the function is replaced by a (looks like) recursive call to itself to which Firebug says,
<i>
</i>too much recursion
onload(undefined)business.php (line 1)
onload(undefined)business.php (line 1)
onload(undefined)business.php (line 1)
onload(undefined)business.php (line 1)
onload(undefined)business.php (line 1)
onload(undefined)business.php (line 1)
onload(undefined)business.php (line 1)
onload(undefined)business.php (line 1)
onload(undefined)business.php (line 1)
... and on and on and on and ...
Copy linkTweet thisAlerts:
@michael879authorSep 25.2007 — ah so the onload="whatever" is actually a function call to onload()? didnt know that, thanks. Guess Ill have to rename my absent onload function. Anyway this has nothing to do with the thread.
Copy linkTweet thisAlerts:
@WebJoelSep 25.2007 — That is what I saw. :p
Copy linkTweet thisAlerts:
@ray326Sep 25.2007 — ah so the onload="whatever" is actually a function call to onload()?[/QUOTE]In C terms, it's a pointer to a function and when you do an on*="foobar()" you replace the value of that pointer with the value of a pointer to YOUR function. What I don't really understand at the moment is the recursion that happened but maybe one of our smarter folks like Fang or Kravvitz will come along and enlighten us. Or if it's making you crazy you might find a guru in the Javascript forum that's come across it.
×

Success!

Help @michael879 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...