Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2007

Tip: Looking for answers? Try searching our database.

how to wrap a long text through css.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Victor - 01 Jun 2007 04:58 GMT
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
Steven Cheng[MSFT] - 01 Jun 2007 10:38 GMT
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/css/properties/text/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.
Victor - 04 Jun 2007 21:50 GMT
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 Victor,
>
[quoted text clipped - 13 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Alexey Smirnov - 04 Jun 2007 22:12 GMT
> Hi Steven
> I have tried this attribute. but it seems this one only worked in IE not
[quoted text clipped - 3 lines]
> Cheers
> Victor

It's an IE-specific non-standard CSS property which works in IE only.
Steven Cheng[MSFT] - 05 Jun 2007 03:46 GMT
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.
Victor - 05 Jun 2007 04:59 GMT
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 Victor,
>
[quoted text clipped - 14 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Alexey Smirnov - 05 Jun 2007 19:52 GMT
> 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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.