Statcounter

13 January 2007

iframe, scrollbars and mozilla

I wanted to embed a menu on all the pages of a website so I wouldn't have to change every instance of it. This can be done using IFRAME, but not content with that I wondered if it could be done with OBJECT since strict HTML doesn't have IFRAME.

It turned out to be possible:

<object data="sidebarframe.html">

The size of the object could be set in the website's Style Sheet. The problem then became the scrollbars that I didn't want. IFRAME has a scrolling="no" style setting, but OBJECT does not. Some CSS in the BODY of the frame solved that, complete with a Mozilla hack:

<style type="text/css">body {border:0; overflow:visible; }</style>
<style type="text/css">body {overflow: -moz-scrollbars-none;}</style>

No comments: