Results 1 to 7 of 7

Thread: Text wrapping

  1. #1

    Thread Starter
    Addicted Member HairyDave's Avatar
    Join Date
    Aug 2002
    Location
    Er...I can't remember.
    Posts
    196

    Text wrapping

    I've got a list in HTML. This list lives in a frame, but when the frame is resized the text inside gets wrapped if the frame becomes too small.

    Is there any way to disable text wrapping - if only 1 word can be seen in the frame then so be it.

    HD

  2. #2
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    There a couple of ways with style. Whitespace is one:

    Code:
      <div style="white-space:nowrap;">Lots of text here</div>
    And overflow

    Code:
      <div style="overflow:auto; width:100%;">Lots of text here</div>
    Also you can use hidden for overflow, but that will result in no scroll bars.

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    There is a <nowrap> tag I think.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4

    Thread Starter
    Addicted Member HairyDave's Avatar
    Join Date
    Aug 2002
    Location
    Er...I can't remember.
    Posts
    196
    I have tried <nowrap> but it doesn't seem to work.

    Anyway, when I do the <div style=.....>Text</div>, the text doesn't wrap - but the list images do. The attachment is a screen shot of what I mean.

    As you can see, the "Request Equipment" item has 'wrapped' from the list image.

    Any way I can stop this?

    HD
    Attached Images Attached Images  

  5. #5
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    I'm pretty sure <nowrap> is proprietary. The style stuff may only work on block level elements (I'm not sure though), so if you're using for example a list item, try encasing it's text in a DIV and setting the style on that.

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    I'd rather use span, but I don't know where the difference would be.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  7. #7
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    <span> is inline, so it would be the same as just <li> really, you want <div> because it's block.

Posting Permissions

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



Click Here to Expand Forum to Full Width