Opera Bug #166082

overflow:hidden; & absolutely positioned content

Fixed in Opera 9.0 Final

If a container element with the CSS property overflow:hidden; is given absolutely positioned content wider than the viewport, Opera bases the width of the document on that width rather than the width of the container. This causes Opera to generate totally unnecessary horizontal scrollbars. Statically (default) positioned content wider than the viewport, and hidden by overflow:hidden;, does not cause these scrollbars.

Below is a <ul> element with an explicit width (350px) and height (1.3em), and the CSS properties overflow:hidden; and position:relative;. Inside are fifteen <li> elements set to position:absolute; and spaced every 100px going towards the right. Thus the last <li> element is positioned 1400px to the right of the <ul>'s left edge.

The last list items should be hidden, and they are; at least visually. Opera's scrollbars, however, tell a different story. You can click the bordered <ul> to expand it and see all the list items; click it again to collapse it back to 350px.

Main Bug List