A css Div question (scroll boxes)

Discussion in 'Web Design and Development' started by torndownunit, Feb 9, 2009.

  1. torndownunit macrumors regular

    Joined:
    Jan 4, 2009
    #1
    I am having problems with the correct wording to do a Google search for this, so I am hoping someone here can help me.

    I have a small div 'box' for text. Is it possible to have that box automatically resize to a certain point, but if it gets bigger than that have it change to a scrolling box?

    I can make a box that auto sizes to the content, or a fixed box that scrolls. I don't know how to combine to the 2, or if I can.

    Thanks a lot.
     
  2. Mal macrumors 603

    Mal

    Joined:
    Jan 6, 2002
    Location:
    Orlando
    #2
    You're looking for max-width and max-height. Don't set specific dimensions, or do it using percentages, then set a max-width or max-height (or both, and probably also min-width and min-height), and the box will not grow beyond that size. Then apply your overflow properties, and you're in good shape!

    jW
     
  3. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #3
    A note about the above advice is that IE6 doesn't understand the min-/max- width/height properties.
     
  4. Photomax macrumors regular

    Joined:
    Nov 26, 2007
    Location:
    Seattle
    #4
    There are work arounds for this but at this stage the best full implementation for conditional IE6 CSS styling is display:none

    Max
     

Share This Page