2017-04-03 92 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