html - 相互移动方块
问题描述
我div
在引导程序中有一个 4 块。我需要将它们彼此更紧密地移动,但我不能这样做:这是 CSS:
.cnt {
height: 1067px;
padding:20px;
margin-top:20px;
margin-bottom:10px;
background: rgba(255, 255, 255, .5);
overflow:hidden;
box-shadow: 0 10px 90px rgba(0, 0, 0, 0.4);
}
@media only screen and (min-width : 480px) {
.cnt {
height: auto;
}
}
@media only screen and (min-width : 768px) {
.cnt {
width: 471px;
height: 452px;
padding: 30px;
}
}
@media all and (max-width: 1170px) {
.cnt {
height: 380px;
}
}
这是 HTML:
<div class="col-md-6 col-xs-12">
<div class="cnt"><img class="feature-icon" src="images/contract.svg"><br>
<br><br><b>Strategic<br>Planning</b><br><br>
Strategic Planning projects help our clients to make
decisions and take actions that match their company’s
skills.</div>
</div>
<div class="col-md-6 col-xs-12">
<div class="cnt"><img class="feature-icon" src="images/analytics.svg"><br>
<br><br><b>Market research</b><br><b>Partner Search</b><br><br>
Our aim is to build a long-term and positive relationship
with our clients and to contribute to business owners’
confidence. </div>
</div>
<div class="col-md-6 col-xs-12">
<div class="cnt"><img class="feature-icon" src="images/weight-balance.svg"><br>
<br><br><b>Coaching</b>
<br><br><br><br>Coaching focuses on future possibilities, not past
mistakes… Coaching thinks of the people in terms
of their potential, not their performance.</div>
</div>
<div class="col-md-6 col-xs-12">
<div class="cnt"><img class="feature-icon" src="images/idea.svg"><br>
<br><br><b>Project</b><br><b>Management</b><br>
<br>An engagement with an objective, start and end date,
aimed to create a product or service may be considered
a project.</div>
</div>
我尝试对每个块使用float:left
, display: inline-block
, 但 id 并没有帮助我。我该如何解决?
解决方案
我认为您需要为<div class="col-md-6 col-xs-12">
元素添加类,并添加自定义 css,如下所示:
.inline { display:inline-block; }
推荐阅读
- c++ - 为什么可以将指针两次放入 unique_ptr 的向量中?
- javascript - 设置控制台输出
- oracle - Toad 和 Oracle 中 PROCEDURE 和 CREATE OR REPLACE PROCEDURE 之间的区别
- flutter - 如何在颤动的卡片内创建步进器小部件或时间线图块?
- c# - 如何调用带参数的 MySQL 过程?
- python - Pygame窗口由于某种原因没有改变颜色
- react-redux - 在不同的路由中保持 Redux 状态
- c++ - 将 nullptr 传递给我的重载函数会导致运行时错误
- typescript - 请求动画帧在每个循环中重置一个递增的变量
- python-3.x - PIL:如何在给定一组无序轮廓尺寸的情况下绘制形状