global scrollbar of two nested block elements

Forums » Dev.Opera » General Web Development Discussions

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

12. April 2010, 13:18:14

Harry2o

Posts: 85

global scrollbar of two nested block elements

Hi,

when I nest a block element within another one (with the height of the nested element being larger than the surrounding one and therefore enforcing a local scrollbar with auto-overflow), Opera (10.0+10.51) create a global scrollbar if the height of the nested DIV exceeds the total screen height.
However, a necessity for this behavior is the positioning. Surrounding: relative, nested: absolute (and yes, there is a reason for that kind of positioning, I need it for other purposes - the code you will see is just a demo fragment).

Firefox does not create a global scrollbar.
Which browser behaves correctly?

See the code for demonstration:

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

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>canvas test</title>
</head>

<body style="background-color: #f0f0f0;">

<div style="overflow: auto; position: relative; width: 100%; height: 300px; border: 1px solid black;">
<canvas width="500px" height="2000px" style="position: absolute; border: 1px solid white;" ></canvas>
</div>
</body>
</html>

Forums » Dev.Opera » General Web Development Discussions