div 滚动到全屏
div into full screen with scroll
如何将 div 滚动到全屏?此代码有效,但滚动条未出现:
html :
<div id="full_screen"></div>
css :
#full_screen {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 10;
}
使用overflow:scroll;
显示卷轴。因为滚动的默认行为是 overflow:auto;
.
#full_screen {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 10;
background:red;
overflow:scroll;
}
.content{
width: 1000px;
height: 1000px;
}
<div id="full_screen"><div class="content"></div></div>
<div id="full_screen"></div>
这是更新后的 css。当 div #full-screen 中的内容超过屏幕所能包含的内容时,就会出现滚动条。
#full_screen {
position: fixed;
width: 100%;
height: 100%;
left: 0;
right:0;
bottom:0;
top: 0;
z-index: 10;
overflow-y: scroll;
}
如何将 div 滚动到全屏?此代码有效,但滚动条未出现:
html :
<div id="full_screen"></div>
css :
#full_screen {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 10;
}
使用overflow:scroll;
显示卷轴。因为滚动的默认行为是 overflow:auto;
.
#full_screen {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 10;
background:red;
overflow:scroll;
}
.content{
width: 1000px;
height: 1000px;
}
<div id="full_screen"><div class="content"></div></div>
<div id="full_screen"></div>
这是更新后的 css。当 div #full-screen 中的内容超过屏幕所能包含的内容时,就会出现滚动条。
#full_screen {
position: fixed;
width: 100%;
height: 100%;
left: 0;
right:0;
bottom:0;
top: 0;
z-index: 10;
overflow-y: scroll;
}