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

how to wrap a long text through css.

P: n/a
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
"ddddddddddddddddddddddddddddddddddddddddddddddddd dddddddddddddddddddddddd"
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
Jun 1 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hi Victor,

For making long text be wrapped, you can consider using the "word-wrap"
attribute. here are some reference article introduct it:

http://www.blooberry.com/indexdot/cs...t/wordwrap.htm

http://msdn2.microsoft.com/en-us/library/ms531186.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Jun 1 '07 #2

P: n/a
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

"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:d7**************@TK2MSFTNGHUB02.phx.gbl...
Hi Victor,

For making long text be wrapped, you can consider using the "word-wrap"
attribute. here are some reference article introduct it:

http://www.blooberry.com/indexdot/cs...t/wordwrap.htm

http://msdn2.microsoft.com/en-us/library/ms531186.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.

Jun 4 '07 #3

P: n/a
On Jun 4, 10:50 pm, "Victor" <vic...@noemail.noemailwrote:
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.

Jun 4 '07 #4

P: n/a
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/...ap-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.

Jun 5 '07 #5

P: n/a
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

"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:sk**************@TK2MSFTNGHUB02.phx.gbl...
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/...ap-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.

Jun 5 '07 #6

P: n/a
On Jun 5, 5:59 am, "Victor" <vic...@noemail.noemailwrote:
Hi Steven:
thanks for the reply. I tried to put the code into my page.. but seems it
still doesnt work for FF?
dddddddddddddddddddddddddddddddddddddddddddddddddd ddddddddddddddddddddddd
is one word, and a white-space attribute will break the line after
this word.

Jun 5 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.