html - Position: fixed scrolls too far -
my question layout in image:
- white box in upper right corner = content box
- the black line @ bottom = footer bar
- the box right = sidebar box
the sidebar set css position: fixed
, follow users scroll.
the problem is, on small screen sizes, user can scroll far, meaning sidebar box, go futher down footer bar.
how can make sidebar stop 20 pixels before hitting footer?
css code:
div#sidebar { margin: 20px 0px 20px 20px; width: 270px; height: 295px; border: 1px solid #ccc; background-color:#fff; padding: 20px; position:fixed; left: 730px; } div#content { margin: 20px 0px 20px 0px; width: 650px; height: 600px; border: 1px solid #ccc; background-color:#fff; float: left; padding: 20px; } div#footer { width: 100%; min-width:1024px; height: 30px; border: 1px solid black; background:#252525; text-align:center; padding-top:10px; color:#555; }
i try adjust #sidebar
margin-bottom
. what's html?
Comments
Post a Comment