【问题标题】:Possible to allow background overflow Bootstrap div可能允许后台溢出 Bootstrap div
【发布时间】:2017-07-02 12:23:19
【问题描述】:

视图是good.Logo 放置在正确的位置。但是希望background-color 也比div 更宽。 (盖住浏览器的孔)

<div class="col-md-12 bannerwithlogo"></div>

.bannerwithlogo {
   height: 65px;
   margin-left: -10px;
   background:  url(//static.websitename.com/css/portals/websiteportal/gfx/logo.png) no-repeat top left;
   background-color: #c30c15;
}

【问题讨论】:

  • 我认为你不能让它比 div 大,所以你可能需要在外面再包裹一个 div 并设置那个 background-color
  • 请做一个工作示例。为你的问题付出一些努力
  • 使用相对的 .bannerwithlogo:before:after 伪元素。
  • 我认为你的父 div 有“容器”类。您需要改用“container-fluid”。

标签: html css twitter-bootstrap twitter-bootstrap-3


【解决方案1】:
   <div class="container-fluid">
    <div class="col-md-12 bannerwithlogo"></div>
    </div>

CSS

.container-fluid{
    height:100px;
    background-color: blue;
  }

.bannerwithlogo
{
  margin:10px 3px 0px 0px;
height: 65px;
background:  url(//static.websitename.com/css/portals/websiteportal/gfx/logo.png) no-repeat top left;
background-color: #c30c15;
}

代码:http://www.bootply.com/Mn2erTu4HD

【讨论】:

    猜你喜欢
    • 2018-09-11
    • 1970-01-01
    • 1970-01-01
    • 2022-01-17
    • 2018-10-01
    • 2021-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多