0%

Web-CSS收藏

水平居中

参考自: css的div垂直居中的方法,百分比div垂直居中

HTML:

1
2
3
<div class="father">
<div class="son">未查询到模板信息, 请先添加模板!</div>
</div>

CSS:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
.father {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
}

.son {
position: absolute;
left: 0;
bottom: 0;
right: 0;
height: 50%;
text-align: center;
color: red;
}

隐藏滚动条

ChromeSafari :

1
.element::-webkit-scrollbar { width: 0 !important }

IE 10+ :

1
.element { -ms-overflow-style: none; }

Firefox :

1
.element { overflow: -moz-scrollbars-none; }