0
我身體的背景是黑色的,我試圖在它下面新建一個使用紅色的圖層。所以如果你向下滾動第一個塊將是黑色的,然後第二個塊將是紅色的。問題是,當我在HTML中設置一個新的容器流體時,即使我在CSS中使用「width:100%」,紅色塊也不適合屏幕的整個寬度。容器液體的寬度短於身體
問題似乎是身體,身體是黑色的,它比容器流體div寬。我怎樣才能解決這個問題?
<html>
<head>
<style>
body { background-color: black; }
.newLayer {background-color: red;
width: 100%;
}
</style>
</head>
<body>
<div class ="container-fluid">
<div class="row">
<h1>This is the first block in all black.</h1>
</div>
</div>
<div class="container-fluid">
<div class="row newLayer">
<h1>This is supposed to be the second layer.</h1>
</div>
</div>
</body>
</html>
你正在使用他們的網站的CSS,我有它的本地。你知道我仍然可以使用這個鏈接使用sass:href =「http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css」 ? – ironSteel