小编hcg*_*ggs的帖子

如何用背景颜色填充整个div

我正在尝试使用背景颜色来填充引导程序中子 div 中的整个 div,但我完全卡住了。我希望正确的部分是黄色的,但它只是突出显示了 div 中的文本。

这是一个小提琴。

我知道我错过了一些非常明显的东西,但是我如何让黄色填满整个col-lg-6div?

.new-section {
  height: 100%;
  padding-top: 150px;
  text-align: center;
  background: #eee;
}

.yellow {
  background-color: yellow;
}
Run Code Online (Sandbox Code Playgroud)
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>

<section id="new" class="new-section">
  <div class="container">
    <div class="row">
      <div class="col-lg-6">
        <h1>Section left</h1>
      </div>
      <div class="col-lg-6 yellow">
        <h1>Section right</h1>
      </div>
    </div>
  </div>
</section>
Run Code Online (Sandbox Code Playgroud)

html css twitter-bootstrap twitter-bootstrap-3

0
推荐指数
1
解决办法
3万
查看次数