...

View Full Version : break or wrap words problem with HTML Div element



johnsql
10-17-2007, 05:54 PM
Buddies,
I have an asp.net page on which I use an HTML Div element to hold text words. The Div is has style attribute like
style="overflow:auto; border: solid 1px #000000; width:350px; height:100px; word-break:break-all;"

The "word-break" style just works with IE not FireFox because it is not a standard one. However, that style does not bring my page word breaks as I expect. The problem is seen as follows for words in the Div (sample words in the Div were split not properly or not into consecutive characters):

He was planned long in advance and that he would talk wi
th coal mine leaders about their disputed retirement progr
am, although he stressed the original purpose of the tr
ip was to discuss issues affecting states bordering on th
e Atlantic.

Please give me some solutions such that
1/ I am able to let the HTML Div element break properly a whole word instead of some letters of that word. (For example, word "with" on the first line should be go to the second line entirely. Similarly, the word "program" on the second line should go entirely to the third line. And so on.)

2/ Please give me a browser-cross solution.

3/ I am able to make the HTML Div editable instead of reading-only at present.

Thanks so much in advance.

ArcticFox
10-18-2007, 09:06 AM
Have you tried:

style="overflow:auto; border: solid 1px #000000; width:350px; height:100px; text-align:justify;"


I guess I don't understand why you're even using word-break:break-all;.

johnsql
10-18-2007, 02:37 PM
Have you tried:

style="overflow:auto; border: solid 1px #000000; width:350px; height:100px; text-align:justify;"


I guess I don't understand why you're even using word-break:break-all;.

Hi ArcticFox,
I tried using "text-align:justify" but the problem was worse; that means there was no wrap word. Any other idea?
Thank in advance.

SumiB
02-03-2011, 07:55 AM
Just use this style alone. Remove word break & Overflow

border: solid 1px #000000; width:350px; height:100px;



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum