0

I have a div (id="c_content) which I want to expand vertically depending on how long the content is without displaying the contents which overflow horizontally.
I am using the following code at the moment and it doesn't seem to work:-

#c_content {
        min-height: 645px;
        max-height: 2000px;
    overflow-y: inherit; overflow-x: hidden;
}

When I use the above code, the content which overflows vertically is hidden. What should happen is, the div should expand vertically in order to show the content. But that doesn't seem to happen.

edit: when I set overflow-y: visible; instead of overflow-y: inherit;, I get a scroll bar for y axis (http://prntscr.com/108wsm) - still not what I wanted.

I would like to know if there is any way to fix this even if I have to user another code like Java or Jquery

3
  • Are you implementing any jQuery code, if you are, can you please post it in an edit? Commented Apr 12, 2013 at 3:32
  • Yes I am implementing any Java or jQuery Commented Apr 12, 2013 at 3:35
  • Try setting up a JSFiddle that replicates your problem -- that way we could experiment Commented Apr 12, 2013 at 3:35

2 Answers 2

1

Use cross browser min-height trick .. It will expand div when necessary.

#c_content { 
   min-height: 645px; 
   height:auto !important; 
   height: 645px;
   max-height:2000px;
}
Sign up to request clarification or add additional context in comments.

Comments

0

inherit is not a valid value for the overflow-y property. Try setting it to overflow-y:visible;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.