Forum Moderators: not2easy

Message Too Old, No Replies

behaviour of clip property

         

calimehtar

8:42 pm on Aug 23, 2003 (gmt 0)

10+ Year Member



I've noticed a weird thing about css clip. In all browsers I've tried - Mozilla, Safari, and IE 5 Mac - content outside the clipped region, but the canvas of the page extends as far as necessary to include the invisible content.

I have a dom/css scroller that extends the width of the page. The content to be scrolled, of course, is wider than the page. Functionally it's fine but the page has a horizontal scrollbar and which when used, will show you a big empty spot at the side of the page.

I'm curious if anyone knows why this is. Reading the spec, I can't imagine why all browsers do it the same way, and why it seems so wrong:
[w3.org...]

BlobFisk

9:45 am on Aug 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



From the W3C:

A clipping region defines what portion of an element's border box is visible.

I wonder if this means that the object still occupies it's full width, but only the dimensions specified in the clip attribute are visible. This would produce a scrollbar like you say.

Why not use the overflow attribute instead?

calimehtar

11:30 am on Aug 25, 2003 (gmt 0)

10+ Year Member



Well, overflow: hidden seems to behave exactly the same way except it's less flexible:
[phoyt.macbox.com...]
[phoyt.macbox.com...]

Is this what you meant?

calimehtar

11:34 am on Aug 25, 2003 (gmt 0)

10+ Year Member



BTW, the second example has the same scrollbar-to-empty-page problem as the first does in IE 5 Mac and Mozilla, but apparenlty not in Safari. Safari does the first one 'wrong' and the second 'right' as far as I'm concerned.