scrolling content between fixed header & footer with variable height

廉价感情. 提交于 2021-02-11 18:24:39

问题


I have a header and a footer, that should be position: fixed,
both have content that varies their height according to the page width, I need the content between them to be scroll-able and that the header & footer will not cover it.
here is an example (of the problem): http://jsfiddle.net/ilyaD/bNSZu/2/
Any ideas for a solution?


回答1:


DEMO

Use max-height,min-height and height as percentages.Along with overflow-y:auto




回答2:


You can set a max-height to #main div and add this style to #main to fire the scroll bar

#main {
   overflow-y:auto; 
}

Working Fiddle



来源:https://stackoverflow.com/questions/10674033/scrolling-content-between-fixed-header-footer-with-variable-height

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!