how to wrap a long text through css.

  • Thread starter Thread starter Victor
  • Start date Start date
V

Victor

Hi all
i have a css question about how to wrap a long text by using css. for
example I have a very long text like
"ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
there is not white space and line break inside the text. how can I wrap this
text and make sure it can be used for most of the browser(IE, FF, sarafi).
and another thing, I thought about using js to control the text length for
each line. but in my website i need consider that user input perhaps is not
english. if i use js, how to handle the situation use input japanese chinese
etc.

Cheers
Victor
 
Hi Steven
I have tried this attribute. but it seems this one only worked in IE not
Firefox and safari. Is there anyway I can do this in those two browsers as
well?

Cheers
Victor
 
Hi Steven
I have tried this attribute. but it seems this one only worked in IE not
Firefox and safari. Is there anyway I can do this in those two browsers as
well?

Cheers
Victor

It's an IE-specific non-standard CSS property which works in IE only.
 
Hi Victor,

Yes, the word-wrap is a IE specific one. So far firefox seems hasn't
supported such a exact attribute for word/text wrap. Here is a web article
mentioned a workaround on this:

#FIREFOX / IE Word-Wrap, Word-Break, TABLES FIX
http://petesbloggerama.blogspot.com/2007/02/firefox-ie-word-wrap-word-break-
tables.html

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi Steven:
thanks for the reply. I tried to put the code into my page.. but seems it
still doesnt work for FF?

My code is
<div style="width:130px">
<table cellpadding="0" cellspacing="0" style="width:130px">
<tr>
<td class="HardBreak" style="width:130px">
<%=Comment%>
</td>
</tr>
</table>
</div>
the hardbreak class is the same as in the example. Do you have any idea why
this happened?

Thanks a lot
Victor
 
Hi Steven:
thanks for the reply. I tried to put the code into my page.. but seems it
still doesnt work for FF?

ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
is one word, and a white-space attribute will break the line after
this word.
 
Back
Top