- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我目前正在处理一个 .psd 模板并使用 Bootstrap 4。我有一个部分有问题,其中包含具有不同内容的多行和多列。主要问题是一列,标题内的文本换行成两行。我如何才能将与此相关的其他 block 内的其他单行标题居中?
Image of the section from mockup
另一个问题是关于分隔线的。将它们作为模型插入哪个选项更好?通过使用之前/之后?
谢谢。
.benefites {
background: #0b3b52;
}
.benefites .headline {
color: #fff;
padding: 30px 0;
font-weight: 100;
text-transform: uppercase;
}
.benefites h4,
.benefites h2 {
color: #92d050;
}
.benefites p {
color: #fff;
}
.benefites .block {
align-self: center;
}
.benefites img {margin: 10px 0;}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<section class="benefites">
<div class="container">
<div class="row">
<div class="col-md-12 text-center">
<h2 class="headline">Managing your team has never been easier!
</h2>
</div>
</div>
<div class="row text-center">
<div class="col-md-3 block">
<h4>Players</h4>
<img src="http://i.piccy.info/i9/f69f598e82ca5dd1e1603b1cc86cc39f/1517595403/422/1218424/icons.png" alt="">
<p>Manage team roster and member profiles easily with our amazing tool</p>
</div>
<div class="col-md-3">
<h4>Players</h4>
<img src="http://i.piccy.info/i9/f69f598e82ca5dd1e1603b1cc86cc39f/1517595403/422/1218424/icons.png" alt="">
<p>Save time and energy! Manage all your teams in one easy-to-use platform </p>
</div>
<div class="col-md-3">
<h4>Practises & Games</h4>
<img src="http://i.piccy.info/i9/f69f598e82ca5dd1e1603b1cc86cc39f/1517595403/422/1218424/icons.png" alt="">
<p> Figuring out the “when and where” has never been easier. Schedule your games, practices, quickly and easily!</p>
</div>
<div class="col-md-3">
<h4>Injuries & Medical records</h4>
<img src="http://i.piccy.info/i9/f69f598e82ca5dd1e1603b1cc86cc39f/1517595403/422/1218424/icons.png" alt="">
<p>Collect all the data about your player’s condition and medical records</p>
</div>
<div class="w-100"></div>
<div class="col-md-3">
<h4>Sponsors & Agents</h4>
<img src="http://i.piccy.info/i9/f69f598e82ca5dd1e1603b1cc86cc39f/1517595403/422/1218424/icons.png" alt="">
<p>Manage all the sponsor and agent information with us </p>
</div>
<div class="col-md-3">
<h4>Contacts</h4>
<img src="http://i.piccy.info/i9/f69f598e82ca5dd1e1603b1cc86cc39f/1517595403/422/1218424/icons.png" alt="">
<p>A full contact database that makes you easy to search, filter, and update</p>
</div>
<div class="col-md-3">
<h4>Contracts</h4>
<img src="http://i.piccy.info/i9/f69f598e82ca5dd1e1603b1cc86cc39f/1517595403/422/1218424/icons.png" alt="">
<p>Get full visibility and handle all the contracts online with CRM42</p>
</div>
<div class="col-md-3">
<h4>Reports</h4>
<img src="http://i.piccy.info/i9/f69f598e82ca5dd1e1603b1cc86cc39f/1517595403/422/1218424/icons.png" alt="">
<p>Our wide range of reports help you to take your management skills to a next level</p>
</div>
<div class="w-100"></div>
<div class="col-md-3">
<h4>Treatments</h4>
<img src="http://i.piccy.info/i9/f69f598e82ca5dd1e1603b1cc86cc39f/1517595403/422/1218424/icons.png" alt="">
<p>Simply the best tool for managing all kind of team payments</p>
</div>
<div class="col-md-6 block">
<h2>
And many more amazing features ...
</h2>
</div>
<div class="col-md-3 ">
<h4>Customized platfrom</h4>
<img src="http://i.piccy.info/i9/f69f598e82ca5dd1e1603b1cc86cc39f/1517595403/422/1218424/icons.png" alt="">
<p>Make the most out of your management tool. Create your own design quickly and easily.</p>
</div>
</div>
</div>
</section>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" </script>
< script src = "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
</script>
最佳答案
首先,删除block
从第一个<div class="col-md-3">
所以他们都顶部对齐。
其次,作为h4
看不到彼此(不是 sibling ),您需要给他们一个固定的高度(您可以使用媒体查询针对不同的屏幕尺寸进行调整)或使用脚本。
这是一个使用固定高度的示例,我在其中添加了这条规则:
.benefites h4 {
height: 50px;
display: flex;
justify-content: center;
align-items: center;
}
这是我的另一个答案,how to get header from cards or similar to have the same height with flex box? ,它有一个脚本版本,还链接到我制作的另一个 CSS 解决方案。
堆栈片段
.benefites {
background: #0b3b52;
}
.benefites .headline {
color: #fff;
padding: 30px 0;
font-weight: 100;
text-transform: uppercase;
}
.benefites h4,
.benefites h2 {
color: #92d050;
}
.benefites h4 {
height: 50px;
display: flex;
justify-content: center;
align-items: center;
}
.benefites p {
color: #fff;
}
.benefites .block {
align-self: center;
}
.benefites img {margin: 10px 0;}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<section class="benefites">
<div class="container">
<div class="row">
<div class="col-md-12 text-center">
<h2 class="headline">Managing your team has never been easier!
</h2>
</div>
</div>
<div class="row text-center">
<div class="col-md-3">
<h4>Players</h4>
<img src="http://i.piccy.info/i9/f69f598e82ca5dd1e1603b1cc86cc39f/1517595403/422/1218424/icons.png" alt="">
<p>Manage team roster and member profiles easily with our amazing tool</p>
</div>
<div class="col-md-3">
<h4>Players</h4>
<img src="http://i.piccy.info/i9/f69f598e82ca5dd1e1603b1cc86cc39f/1517595403/422/1218424/icons.png" alt="">
<p>Save time and energy! Manage all your teams in one easy-to-use platform </p>
</div>
<div class="col-md-3">
<h4>Practises & Games</h4>
<img src="http://i.piccy.info/i9/f69f598e82ca5dd1e1603b1cc86cc39f/1517595403/422/1218424/icons.png" alt="">
<p> Figuring out the “when and where” has never been easier. Schedule your games, practices, quickly and easily!</p>
</div>
<div class="col-md-3">
<h4>Injuries & Medical records</h4>
<img src="http://i.piccy.info/i9/f69f598e82ca5dd1e1603b1cc86cc39f/1517595403/422/1218424/icons.png" alt="">
<p>Collect all the data about your player’s condition and medical records</p>
</div>
<div class="w-100"></div>
<div class="col-md-3">
<h4>Sponsors & Agents</h4>
<img src="http://i.piccy.info/i9/f69f598e82ca5dd1e1603b1cc86cc39f/1517595403/422/1218424/icons.png" alt="">
<p>Manage all the sponsor and agent information with us </p>
</div>
<div class="col-md-3">
<h4>Contacts</h4>
<img src="http://i.piccy.info/i9/f69f598e82ca5dd1e1603b1cc86cc39f/1517595403/422/1218424/icons.png" alt="">
<p>A full contact database that makes you easy to search, filter, and update</p>
</div>
<div class="col-md-3">
<h4>Contracts</h4>
<img src="http://i.piccy.info/i9/f69f598e82ca5dd1e1603b1cc86cc39f/1517595403/422/1218424/icons.png" alt="">
<p>Get full visibility and handle all the contracts online with CRM42</p>
</div>
<div class="col-md-3">
<h4>Reports</h4>
<img src="http://i.piccy.info/i9/f69f598e82ca5dd1e1603b1cc86cc39f/1517595403/422/1218424/icons.png" alt="">
<p>Our wide range of reports help you to take your management skills to a next level</p>
</div>
<div class="w-100"></div>
<div class="col-md-3">
<h4>Treatments</h4>
<img src="http://i.piccy.info/i9/f69f598e82ca5dd1e1603b1cc86cc39f/1517595403/422/1218424/icons.png" alt="">
<p>Simply the best tool for managing all kind of team payments</p>
</div>
<div class="col-md-6 block">
<h2>
And many more amazing features ...
</h2>
</div>
<div class="col-md-3 ">
<h4>Customized platfrom</h4>
<img src="http://i.piccy.info/i9/f69f598e82ca5dd1e1603b1cc86cc39f/1517595403/422/1218424/icons.png" alt="">
<p>Make the most out of your management tool. Create your own design quickly and easily.</p>
</div>
</div>
</div>
</section>
关于html - 具有不同大小内容的相等 flexbox 网格 + 分隔符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48588724/
使用 ListView.separated 我们可以在列表项之间添加 Divider(),但是,一旦我转换到 SliverList,我就看不到我的分隔线了。 delegate: SliverChild
使用 ListView.separated 我们可以在列表项之间添加 Divider(),但是,一旦我转换到 SliverList,我就看不到我的分隔线了。 delegate: SliverChild
我对 Angular 还很陌生。我有一个由一些数据填充的列表项: {{content.Company}} {{content.Town}}, {{content.P
我正在尝试从 SwiftUI 中的 List 中删除“行”分隔符(在 SwiftUI 中称为分隔符)。 我浏览了 List 文档,但我没能找到它的修饰符。 如有任何帮助,我们将不胜感激。 最佳答案 i
我有一个带有 4 个按钮的网格...1 行 4 列。我正在寻找一种方法将左侧的两个按钮与右侧的两个按钮进行视觉分组。我一直在寻找一种使用分隔符执行此操作的方法,但它似乎与 Grid 一起玩得不好,更喜
我对 R 语言相当陌生。所以我有这个包含以下内容的向量: > head(sampleVector) [1] "| txt01 | 100 | 200 | 123.456
我正在尝试连接两列中的值,当我使用 =CONCAT(A2,",",B2) 时,它将连接两列并获得正确的结果 (P0810,P1)。但我正在寻找的是这样的东西(“P0810”,“P1”)。我尝试了 =C
我在这里创建了一个简单的演示。在 amount 字段编辑时,我想显示 , 分隔符?目前,它仅在不处于编辑模式时显示 ,。知道如何实现这一目标吗? DEMO IN DOJO var data = [{
这里是java菜鸟... 这让我抓狂,因为我知道这很简单,但我已经为此工作了 30 分钟...... 这是来自代码战斗: 对于参数 = ["Code", "Fight", "On", "!"] 且分隔
基于这个pywin32基础script如何向托盘菜单 menu_options 添加分隔符? 我还可以让菜单在左键单击时弹出,而不仅仅是右键单击吗? 最佳答案 将 notify 函数(从 URL 中的
我正在使用这段代码: StringTokenizer tokenizer=new StringTokenizer(line, "::"); 拆分以下字符串: hi my name is visghal
- Dropbox login fix - Updated iris viewer * other aspects are to be improved + fix crash on viewing
我试图在每个菜单组之间显示一个分隔线。我已经尝试过为每个组提供一个唯一的 ID,但这没有用。我找到了一些其他解决方案,但它们看起来有点奇怪,比如创建高度为 1dp 的 LinearLayout。 这是
我想为 CONCAT_WS() 选择一个与字段值不冲突的分隔符例如,如果我选择“,”,则字段值可能包含带有“,”的字符串我想选择一个与字段值不冲突的分隔符:( 最佳答案 来自here : CONCAT
我想知道 Sphinx 引擎是否可以使用任何定界符(如普通 MySQL 中的逗号和句点)。我的问题来自于一种冲动,根本不使用它们,而是逃避它们,或者至少在使用 FULLTEXT 搜索执行 MATCH
我正在尝试使用 svg 或纯 css3 制作 header 分隔符,如下所示: preview from design 在 header 中我有标准的 bootstrap 4 轮播
我在使用 CSS 分隔符时遇到了一些难题。看看:http://jsfiddle.net/fVxC6/1/ .div-line { border-bottom: 1px solid #f0f0f
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 关闭 7 年前。 编辑问题以包含 desired behavior, a specific probl
嘿,我正在尝试使用 getline 读取以下行 (15,0,1,#) (2,11,2,.) (3,20,0,S) 我希望能够将整数提取为 int,将字符提取为 char,但我不知道如何只提取它们。 最
我有 2 列,每边 float 一列,我想使用 1px 宽度的线分隔符,从最长列的顶部到底部。 我宁愿远离 TABLE 布局,而且我不知道哪一个将是最长的列,或者它会有多长。 我怎么能只用 css 做
我是一名优秀的程序员,十分优秀!