By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,341 Members | 1,553 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,341 IT Pros & Developers. It's quick & easy.

prevent text to slide from a div

P: 6
hello,
i have created a div with a text inside it and i gave it a width.
when i put a long text line inside it without space, the text is sliding out of the div.

does anybody knows how do i prevent the text slide that it will brake the word when it gets to the edge of the div.


thx.
May 20 '08 #1
Share this Question
Share on Google+
9 Replies


Death Slaught
100+
P: 1,137
Please provide your code or a link to a test site.

Thanks,
{\_/}
(' . ')
(")[DEATH](")
(")(")
May 20 '08 #2

hsriat
Expert 100+
P: 1,654
provide min-width instead of width.
May 20 '08 #3

Death Slaught
100+
P: 1,137
min-width doesn't exist in IE though....

Thanks,
{\_/}
(' . ')
(")[DEATH](")
(")(")
May 20 '08 #4

hsriat
Expert 100+
P: 1,654
ohh... I never knew that.

I hate IE.
May 20 '08 #5

Death Slaught
100+
P: 1,137
I'm fairly certain that it's min-width that or it's min-height... or both. I'll check in a moment.

Thanks,
{\_/}
(' . ')
(")[DEATH](")
(")(")
May 20 '08 #6

Death Slaught
100+
P: 1,137
Found it:

Height does not work correctly in IE. IE treats height as 'min-height'. And, as you might expect, min-height doesn't work at all in IE.
Thanks,
{\_/}
(' . ')
(")[DEATH](")
(")(")
May 20 '08 #7

P: 6
guy, thx for the comments,

an example code of what my problem is:

just copy and paste it.
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2.         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5.   <title>ten la ba rosh</title>
  6.   <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  7. </head>
  8. <body>
  9. <h1>script.aculo.us test file</h1>
  10.  
  11. <div style="width: 100px; border: 1px solid; float: left;">    
  12.     <div style="float: left; ">
  13.     glskd l;sjk fg sjdjs  dkl; gj slkdgskldgs kldjf
  14.     fgkl;sjdf;gklsjdf;gjks d;fklgjsdlkf;gjsdkl;fgs
  15.     dfgsdklfgjlk;sgjskl;dgh jksl;dhfgjsldhfgjklshdfgjkshdfg\
  16.     sdfgsdhfgjkl;sdhfg;jsldhfgs
  17.     dfghsdkflghsdfjlghsdjlghuitghsdfhgsjlthgsuptghsdj;fghsjdfghsdufghs
  18.     fgshdlfghs;dfjgs
  19.     </div>
  20. </div>
  21.  
  22. </body>
  23. </html>
May 21 '08 #8

hsriat
Expert 100+
P: 1,654
Oh... so you mean by including a div in another div of fixed width?
May 21 '08 #9

P: 6
sorry for the long time...

yes i mean a div within a div, and when i enter a text without any space between the words.

i am not sure that it is possible, but maybe i am missing something, or there is a hack.

thx anyway for all the replys.
May 27 '08 #10

Post your reply

Sign in to post your reply or Sign up for a free account.