skywind
skywind

Reputation: 964

Overflow content auto inside overflow hidden?

I have a div with height in % and overflow: hidden;. Inside a div with overflow: auto doesn't show scroll when content is big.

Is it posible to do that i want?

Live: http://indorio.ru/inside-box.html (#overlay-box fluid with height of %)

Upvotes: 8

Views: 11242

Answers (1)

i_like_robots
i_like_robots

Reputation: 2787

Overflow requires a height to be specified, otherwise the element will wrap its contents. Depending on your situation you could specify the height as 100%:

#outer {
  height: 400px;
  padding: 10px;
  background: red;
}
#inner {
  height: 75%;
  padding: 10px;
  background: blue;
}
#scroll {
  overflow: auto;
  height: 100%;
  background: green;
}
#content {
  height:400px;
}

http://jsfiddle.net/3xe7k/

Upvotes: 13

Related Questions