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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Aug 2010
    Posts
    418
    Thanks
    18
    Thanked 2 Times in 2 Posts

    Overflowing text limitation?

    Hopefully this is a quick thing...

    If there is a block of text inside a div tag that is set to height:0 and overflow:visible, is it possible to limit the number of lines the text wraps to, when a window is resized.

    hopefully that made sense. I tried adding a max-height on the p tag, but that didn't do it. I tried another div that is limited, but that didn't work.

    Might be another, better way to do this. I was just hoping I could do it with the parent div at height:0, for layout purposes.

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    have you tried adding a max-height alongside the height on the parent div? Possibly also then get rid of the overflow:visible.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

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