Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

break or wrap words problem with HTML Div element

Status
Not open for further replies.

johnjsforum

Programmer
Jul 30, 2007
11
US
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:

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.

 
Hi

1/ I do not understand what you want. The default behavior in all browsers ( at least as many as I know ) is to wrap on word breakes.

2/ Remove [tt]word-breake[/tt]. Without that is certainly cross browser.

3/ Start with thread216-1401960.

Feherke.
 
1/ I do not understand what you want. The default behavior in all browsers ( at least as many as I know ) is to wrap on word breakes.

>> I attached my problem with IE and FireFox for the HTML Div element when the page is rendered, and the problem is the words in the Div is split into not-consecutive characters: (sample texts in the Div is broken separately)


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.

2/ Remove word-breake. Without that is certainly cross browser.

>> If I remove style "word-break", then there is nothing to break words. How does that 'removing' become cross browser solution?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top