答案 0 :(得分:2)
你真的不需要Bootstrap!
如果您无法运行代码段,则这是CodePen上的笔:http://codepen.io/kranzy/pen/bwqWbo
body {
margin: 0;
}
.full {
position: absolute;
width: 100%;
height: 100%;
background-color: red;
overflow: hidden;
}
.inside {
position: relative;
/* some bit of margins */
top: 50px;
left: 50px;
/* calculate the width, if not, weird effect. */
width: calc(100% - 50px * 2);
height: calc(100% - 50px * 2);
/* 50px * 2 because 50px is just enough for the .inside div's width and height not to fall out of screen. */
/* make it like your image */
background-color: blue;
overflow: auto;
}
<div class="full">
<div class="inside"></div>
</div>
答案 1 :(得分:0)
<div class="main" style="background-color:red; height:100vh; float:left; width:100%;>
<div class="wrapper" style="width:1170px;margin:0 auto">
<div class="main-text" style="float:left; width:100%; background-color:blue;">
</div>
<div>
</div>