Jimmy
Jimmy

Reputation: 47

DIV content does not overflow

The code below works properly in all browsers but IE. The overflow doesn't work. Thanks.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<style type="text/css">
#scroll {
  width: 500px;
  height: 250px;
  overflow: auto;
}

.box {
  position: relative;
  height: 100px;
}
</style>

</head>
<body>
  <div id='scroll'>
    <div class='box' style="background-color: red;"></div>
    <div class='box' style="background-color: black;"></div>
    <div class='box' style="background-color: yellow;"></div>
    <div class='box' style="background-color: blue;"></div>
    <div class='box' style="background-color: green;"></div>
  </div>
</body>
</html>

Upvotes: 2

Views: 331

Answers (2)

S.Jones
S.Jones

Reputation: 1155

If you remove the "position:relative;" from the .box CSS definition, I believe it'll work in FF and IE 6.0.

Edit: I've tested it - and it works in FF 3.6.8 and I.E. 6.0.28 (i.e. keeps the 100px boxes within the scroll div).

Upvotes: 1

user431821
user431821

Reputation:

Is this what you are looking for? http://snook.ca/archives/html_and_css/position_relative_overflow_ie/

Upvotes: 1

Related Questions