...

View Full Version : div stretching with text with no space



SeeIT Solutions
05-22-2005, 03:36 PM
Hi,

I have a div set to width 750px is there a way to make it wrap a word that is too long if it is entered? at the moment it is just stretching and looking terrible.

Thanks

mark87
05-22-2005, 03:43 PM
word-wrap: break-word;

...should fix it. Think that's IE only though...? :o

_Aerospace_Eng_
05-22-2005, 05:36 PM
Well wait, if its a div set to a fix width, it should go to the next line. It would be helpful if we saw your code! I don't know how many times I have told that to people on these forums. How do you expect us to give you a good answer rather than us just guessing?

mark87
05-22-2005, 09:49 PM
Nope even with a fixed width, the DIV will expand when the content does not fit in it.

eg.



<html>
<head>
<style type="text/css">
#main { width: 200px; background-color: #DDD }
</style>
</head>
<body>
<div id="main">
superlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlong textsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuper longtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtext
</div>
</body>
</html>

_Aerospace_Eng_
05-22-2005, 10:03 PM
Of course not, that word is huge, why on earth would someone put in a word that huge?

mark87
05-22-2005, 10:24 PM
No idea... but SeeIT Solutions' word has to be longer than 750px's... :eek:

mrruben5
05-23-2005, 12:08 AM
You should be using a server side script for this, this is about content, not design...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum