Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Senior Member kade119's Avatar
    Join Date
    Feb 2007
    Location
    USA
    Posts
    532
    Member #
    14888
    Liked
    1 times
    can someone tell me why <br /> doesn't work w/ text that uses overflow:auto?

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    You're not supposed to use overflow on a text element (p, span, li, etc.).

    Use it on a container (div) and put text elements inside, and it will work fine:

    Code:
    <div style="width: 400px; height: 100px; overflow: auto">
        <p>This is<br />
            some text...</p>
    </div>

  4. #3
    Senior Member kade119's Avatar
    Join Date
    Feb 2007
    Location
    USA
    Posts
    532
    Member #
    14888
    Liked
    1 times
    Quote Originally Posted by transio
    You're not supposed to use overflow on a text element (p, span, li, etc.).

    Use it on a container (div) and put text elements inside, and it will work fine:

    Code:
    <div style="width: 400px; height: 100px; overflow: auto">
        <p>This is<br />
            some text...</p>
    </div>
    thanks mate!



    but i the breaks still dont work in ie6

  5. #4
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Umm... p is a containing (block-level) element.

    Is it specific to elements with overflow auto? i.e., if you set a different overflow value, do the line breaks work?

  6. #5
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Quote Originally Posted by Shadowfiend
    Umm... p is a containing (block-level) element.
    Thinking about it, you're right, and theoretically, one could set overflow on a p element.

    However, it wouldn't be too useful as a scrollable element, since one usually wants multiple paragraphs of content in a scrolling pane.

  7. #6
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Tested in IE7 and works fine...
    Attached Images Attached Images


Remove Ads

Posting Permissions

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

Search tags for this page

div auto line break

,

overflow line break

Click on a term to search for related topics.
All times are GMT -6. The time now is 11:38 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com