admin管理员组文章数量:1323737
I have an absolute positioned div that I need to get to to fill the entire document for a background to a modal window.
I can get it to fill the window but when there is a scroll bar it doesnt fill the area that is currently visible.
This is my current code:
position:absolute;
top:0;
left:0;
height:100%;
min-height:100%;
By the way I can get it to fill the document horizontally.
I have an absolute positioned div that I need to get to to fill the entire document for a background to a modal window.
I can get it to fill the window but when there is a scroll bar it doesnt fill the area that is currently visible.
This is my current code:
position:absolute;
top:0;
left:0;
height:100%;
min-height:100%;
By the way I can get it to fill the document horizontally.
Share Improve this question edited Jan 11, 2011 at 10:49 manycheese asked Jan 11, 2011 at 10:41 manycheesemanycheese 3,6852 gold badges20 silver badges11 bronze badges3 Answers
Reset to default 9Give the div position:fixed
and top,bottom,left,right 0
See here: http://jsfiddle/sQLPr/
edit - removed the following line
- and it's parent (probably body) position:relative
div.covered {position: fixed; top:0; left:0; bottom:0; right:0;}
test it here: http://jsfiddle/meo/kGUYG/2/
Position absolute is gonna scroll when you scroll the page unless you find a JS solution. You need to use position fixed so the element does not scroll when the content does.
Put it in a table with 100% width and that's all
本文标签: javascriptModal Div to fill entire window including below foldStack Overflow
版权声明:本文标题:javascript - Modal Div to fill entire window including below fold - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742119277a2421619.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论