如何阻止padding div孩子?

时间:2016-05-05 10:52:41

标签: css twitter-bootstrap-3

我有这个示例代码:

<div class="container">
    <div class="row">
        <div class="left-block" style="background-color:#000000">menu</div>
        <div class="text various">text article</div>
    </div>
</div>

左边块类有背景颜色,但是背景按高度菜单停止,但是我喜欢背景继续并停止结束页面,但是如果插入左边块填充底部= 100%高度左边 - 块增加高度=&#34; row&#34;和类文本 - 各种,我喜欢填充停止高度行或高度文本 - 各种

请帮助我

1 个答案:

答案 0 :(得分:0)

据我所知,你需要这样的东西:

.row {
  display: flex;
}

.left-block {
  color: #fff;
  padding: 8px;
}

.text {
  padding-left: 8px;
}
<div class="container">
    <div class="row">
        <div class="left-block" style="background-color:#000000">menu</div>
        <div class="text various">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Reprehenderit quia aperiam, ex fugiat! Ad odio voluptatem magnam, alias, voluptatibus vero corporis adipisci quos dicta, asperiores consequatur maiores iste unde dolore. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Reprehenderit quia aperiam, ex fugiat! Ad odio voluptatem magnam, alias, voluptatibus vero corporis adipisci quos dicta, asperiores consequatur maiores iste unde dolore.  
      </div>
    </div>
</div>