Slidebars icon indicating copy to clipboard operation
Slidebars copied to clipboard

Fixed header before scrollbar

Open bartrylant opened this issue 7 years ago • 2 comments

I want to use sidebars with a fixed header. Followed these instructions (https://www.adchsm.com/slidebars/help/advanced-usage/elements-with-fixed-positions/). The header is fixed, but it appears in front of the scrollbars. Also, the width is set to exact window size, instead of the window size minus the width of the scrollbars. This causes alignment issues if you center content on the page, and content inside the fixed header.

bartrylant avatar Jul 30 '17 15:07 bartrylant

My page structure looks like this, the wrapper div given by the CMS.

<!doctype html>
<html>
  <head>...</head>
  <body>
    <div id ="wrapper">
        <header id="header" canvas=""></header>
        <div canvas="container"></div>
        <div off-canvas="id-1 right push"></div>
        <footer id="footer" canvas=""></footer>
    </div>
  </body>
</html>

The header has a fixed position. Header and footer are pushed aside as they should. However I need to override body, html { overflow: hidden; } to auto, as otherwise the page can't be scrolled. Setting #wrapper to overflow: auto doesn't show any effect, and [canvas="container"] { overflow-y: auto } isn't working either.

On the other hand it's semioptimal showing a scrollbar for the content and second one for the navigation ...

Edit: so, now I chose the above structure, set body, html { overflow: hidden; min-height: 100%; } and it seems to work just fine.

Anke avatar Aug 10 '17 14:08 Anke

I had to increase the z-index on my fixed element, and its working fine now.

jackvial avatar Nov 05 '17 18:11 jackvial