search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

2 answers
Q&A css单位vh,100vh 为什么会出现滚动条
css单位vh,100vh 为什么会出现滚动条
大家讲道理 2016-11-12 13:52:00 Views 2412

0
.div{     height: 100vh; }

页面垂直方向出现了一小段滚动条,不是说 vh 参照的是window.innerHeight吗?为什么还会出现滚动条??

Your Answer
submit

2 answers
0

你好,你的body的margin值没有清零

body{margin:0;}


2016-11-12 13:52:10

submit

0

vh确实是相对于屏幕的,但默认body有一个margin,100%加上这个margin就超出了。清除body的margin即可。

2016-11-12 13:52:16

submit

Popular tool

vc9-vc14 (32+64 bit) runtime library collection (link below)

vc9-vc14 (32+64 bit) runtime library collection (link below)

Download the collection of runtime libraries required for phpStudy installation

VC9 32-bit

VC9 32-bit

VC9 32-bit phpstudy integrated installation environment runtime library

PHP programmer toolbox full version

PHP programmer toolbox full version

Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit

VC11 32-bit

VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use