2017-04-03 100 views
-1

我想创建一个div,就像Bootstrap中的jumbotron类一样。尝试了一切堆叠,但没有得到任何地方。Make div like bootstrap jumbotron

<!DOCTYPE html> 
<html lang="en"> 

<head> 
    <title>Center</title> 
    <style> 
    .centerlize { 
    width: 100%; 
    width: 100wh 
    background-color: blue; 
    color: white; 
    } 
    </style> 
</head> 

<body> 
    <div class="centerlize"> 
    <h1>Test</h1> 
    </div> 
</body> 

一些你能帮助我明白我在这里失踪?

回答

0

没有wh它是vh的视口高度,并且不要忘记CSS属性值后面的分号。除非你想要视口宽度为vw,但是你的“jumbotron”没有高度。

.centerlize { 
    width: 100%; 
    height: 100vh; 
    background-color: blue; 
    color: white; 
} 

演示:http://www.bootply.com/y5k73sN2nE