how to wrap a long text through css.

Discussion in 'ASP .Net' started by Victor, Jun 1, 2007.

  1. Victor

    Victor Guest

    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
     
    Victor, Jun 1, 2007
    #1
    1. Advertising

  2. Steven Cheng[MSFT], Jun 1, 2007
    #2
    1. Advertising

  3. Victor

    Victor Guest

    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]" <> wrote in message
    news:...
    > 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, Jun 4, 2007
    #3
  4. On Jun 4, 10:50 pm, "Victor" <> wrote:
    > 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.
     
    Alexey Smirnov, Jun 4, 2007
    #4
  5. 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.
     
    Steven Cheng[MSFT], Jun 5, 2007
    #5
  6. Victor

    Victor Guest

    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]" <> wrote in message
    news:...
    > 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, Jun 5, 2007
    #6
  7. On Jun 5, 5:59 am, "Victor" <> wrote:
    > 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.
     
    Alexey Smirnov, Jun 5, 2007
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon
    Replies:
    26
    Views:
    14,435
    Simon
    Mar 24, 2006
  2. Keithb
    Replies:
    1
    Views:
    1,528
    Siva M
    Nov 3, 2006
  3. Aaron Fude

    To wrap or not to wrap?

    Aaron Fude, May 8, 2008, in forum: Java
    Replies:
    12
    Views:
    722
    Chronic Philharmonic
    May 10, 2008
  4. Art Werschulz

    Text::Wrap::wrap difference

    Art Werschulz, Sep 22, 2003, in forum: Perl Misc
    Replies:
    0
    Views:
    258
    Art Werschulz
    Sep 22, 2003
  5. Art Werschulz

    Text::Wrap::wrap difference

    Art Werschulz, Sep 24, 2003, in forum: Perl Misc
    Replies:
    1
    Views:
    262
    Anno Siegel
    Sep 25, 2003
Loading...

Share This Page