Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    May 2005
    Posts
    563
    Thanks
    0
    Thanked 3 Times in 3 Posts

    div stretching with text with no space

    Hi,

    I have a div set to width 750px is there a way to make it wrap a word that is too long if it is entered? at the moment it is just stretching and looking terrible.

    Thanks

  • #2
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    word-wrap: break-word;

    ...should fix it. Think that's IE only though...?

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Well wait, if its a div set to a fix width, it should go to the next line. It would be helpful if we saw your code! I don't know how many times I have told that to people on these forums. How do you expect us to give you a good answer rather than us just guessing?

  • #4
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Nope even with a fixed width, the DIV will expand when the content does not fit in it.

    eg.

    Code:
    <html>
    <head>
    <style type="text/css">
    #main { width: 200px; background-color: #DDD }
    </style>
    </head>
    <body>
    <div id="main">
    superlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtextsuperlongtext
    </div>
    </body>
    </html>

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Of course not, that word is huge, why on earth would someone put in a word that huge?

  • #6
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No idea... but SeeIT Solutions' word has to be longer than 750px's...

  • #7
    Regular Coder
    Join Date
    Nov 2004
    Location
    The Netherlands
    Posts
    551
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You should be using a server side script for this, this is about content, not design...
    CATdude about IE6: "All your box-model are belong to us"


  •  

    Posting Permissions

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