473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

how to wrap a long text through css.

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
6 3725
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: name | last post by:
Back for more critique. ---------------------------------------------------------------- #include <stdio.h> #include <stdlib.h> #include <string.h> #include <limits.h> #define MAX 10000
3
by: ColinC | last post by:
Hi, as a newbie to Visual Studio C# Forms development, I'd like some advice on the following. I have a form with a tab control. I have some tab titles that are three words e.g "house &...
3
by: FUGATO | last post by:
I need to help to wrap up text. I have a line all the text and I need to wrap the text with 40 characters each line but without using function. Somebody help me about that and give me an idea
1
by: Keithb | last post by:
I have a GridView control with two item template columns, each containing a label control. One of the label controls wraps on long text strings, increasing the height of the row. The other one does...
0
by: Keithb | last post by:
I have a GridView control with 2 template columns. Both contail a Label control in their ItemTemplate. The right column label wraps text on long strings, the left column just gets wider with long...
1
by: laura.paterson | last post by:
Hi, I'm new to html, and having difficulty getting my text to wrap around an image the way I'd like it to.. I have an image in the top left corner of a component, and if there is space, I'd...
1
by: duzhidian | last post by:
Hello: I just want to use a two columns web. If I put sidebar on the right, it there is a list, it's fine. If it is a paragraph, the width will not work? Why? In the following example,...
1
by: bussasrinivas | last post by:
How to wrap up text shown with a table cell after a certain length intervals ? -------------------------------------------------------------------------------- I have a requirement to wrap a...
15
by: removeps-groups | last post by:
How to wrap text in <ptag if the text has no spaces and is very long? Here is an example: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.