css - Complex full width grid
问题描述
How can I have this header 'full width'. So that the image is on the left side of the screen. But that the content inside (President Jean ...) is in the grid?
I was thinking about creating a new container.
.container--full { max-width: 1400px; width: 100%; }
My .container grid has a max-width of 1170px. So my new container is wider than .container.
And then set a background-image, position left and background color grey. Inside that .container--full, create .container
<div class="container--full">
<div class="container">
</div>
</div>
Test with container-fluid.
<div class="container-fluid" style="background-image: url('<?php bloginfo('template_directory'); ?>/images/commission-header.png');">
<div class="container">
<div class="col-sm-3">
<div class="info">
President
</div>
</div>
<div class="col-sm-9">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Maxime obcaecati consequatur illum dolor quasi labore molestiae voluptatum consectetur laborum vel, modi nulla totam blanditiis quam sapiente, suscipit laudantium. Necessitatibus, eos.
</div>
</div>
</div>
CSS
.commission-business {
.container-fluid {
background-color: $grey--lighter;
background-position: left top;
background-repeat: no-repeat;
}
.info {
background: red;
display: block;
padding: 1rem 2rem;
}
}
解决方案
只需使用引导程序“容器流体”类。(学到更多)
<div class="container-fluid">
<div class="row>
...
</div>
</div>
推荐阅读
- mysql - 如何在关系表的同一列中获取具有两个结果的项目
- accessibility - 在 Android Espresso 中进行可访问性测试时抑制失败的工作示例?
- laravel - findOrFail 返回正确和错误的记录
- python - 使用“或”运算符时,re.findall 不返回完全匹配
- user-defined-functions - 雪花标量 UDF 返回 无法评估不支持的子查询类型
- java - 带有自定义 UserDetails 实现的 java.io.NotSerializableException
- go - 在 Goroutine 中延迟调用 sync.WaitGroup.Wait():为什么要这样做?
- c# - 如何通过 devexpress winform 中的功能区控件
- overlay - 用 ipyleaflet 覆盖 GeoTIFF 图像
- woocommerce - 是否建议在 Woocommerce 中为 SKU 使用类似“/”这样的字符?