SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cool prevent text from wrapping

    My requirements:

    1)A string of text in a div tag that does not wrap if the browser window is reduced in size.

    2)The width of the div tag is as small as the string of text, without explicity stating the width in pixels, ems, etc.

    For example:

    Code:
    div.title {
    	width: auto;
    }
    
    ...
    
    <div class="title">This is my non-wrapping title</div>
    The above code achieves a minimal width, but the text wraps. I do not want to use the "pre" element because I would rather do it all in CSS if possible. Thanks for your help!
    Last edited by ed644; Jun 17, 2002 at 13:03.

  2. #2
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found the solution I was looking for:

    Code:
    div.title {
    	white-space: nowrap;
    	width: auto;
    }


Bookmarks

Posting Permissions

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