移动端的界面中滚动条的显示
第一种方式
将html和body的高度设置为100%;使他与屏幕的高度相同。
html{
height: 100%;}
并将body设置为弹性
body{height:100%;display: flex; flex-direction: column;}
flex-direction: column;使主轴方向为垂直方向,起点在上沿。)
header设置为
flex-shrink:0;
(不让header伸缩)
(header 为页面的头部,为H5新增标签)
footer也设置为
flex-shrink:0;
(也不让footer伸缩)
(footer 为页面的尾部,为H5新增标签)
然后其余的中间内容(section里面的内容)让它显示滚动条,
section{overflow:auto;}
(overflow:auto;溢出内容显示为滚动条。 section是H5新增标签,表示部分独立内容。)
section{
flex-shrink: 1<