www.webdeveloper.com
Results 1 to 3 of 3

Thread: breaking a word to wrap it

  1. #1
    Join Date
    May 2006
    Location
    North of the South Pole
    Posts
    590

    Arrow breaking a word to wrap it

    Okay, here's my html:

    HTML Code:
    <td colspan="2" class="content">
    <b><i>
    wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
    </i></b>
    </td>
    and the CSS for .content:

    Code:
    width:480px;
    max-width:480px;
    padding:10px 10px 10px 10px;
    background-color:#009999;
    In Safari, all of the w's extend past the side of the table cell, and in FireFox, the table widens itself, even though the max-width is set! There is no <pre> involved. How do I make it wrap lond words so it looks something like the following?

    wwwwwwwwwwwwwwwwwwwwwwww
    wwwwwwwwwwwwwwwwwwwwwwww
    wwwwwwwwwwwwwwwwwww

    or

    wwwwwwwwwwwwwwwwwwwwwwww-
    wwwwwwwwwwwwwwwwwwwwwwww-
    wwwwwwwwwwwwwwwwwww

    rather than

    wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
    P.S. If it matters, I'm using XHTML 1.0 Transitional
    Last edited by shane.carr; 09-23-2006 at 01:34 PM.
    "I have no special talent. I am only passionately curious." Albert Einstein

  2. #2
    Join Date
    Jan 2005
    Location
    Frankfort, KY, USA
    Posts
    6,167
    You can use the "word-break" property: http://www.w3.org/TR/css3-text/#word-break
    (there are several word/text break properties on this same page -- take a look.)

    Note -- Some of these may not work in IE.
    KDLA
    Last edited by KDLA; 09-23-2006 at 06:55 PM.
    FYI
    * My screen resolution is set at 1680x1050
    * I'm accessing your site through a T1 line
    * I'm probably viewing it using Firefox (unless browser is specified)

  3. #3
    Join Date
    May 2006
    Location
    North of the South Pole
    Posts
    590
    No success. word-wrap:break-word; works, but not in FireFox!
    "I have no special talent. I am only passionately curious." Albert Einstein

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles