【发布时间】:2018-03-09 10:30:46
【问题描述】:
我试图连续显示 3 次“测试”名称,并在第二行显示 3 次,但它没有显示水平行中的部分
相反,它以垂直 col 模式向我展示了所有内容...
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/styles.css">
<title>bootstrap</title>
<div class="services container">
<h2>Services</h2>
<div class="row">
<section class="col-md-6 col-md-4">
<img class="icon" src='images/cabbage.png' alt="Icon">
<h3>Vegitables</h3>
<p>Bootstrap includes a responsive, mobile first fluid grid system that appropriately scales up to 12 columns as the device or viewport size increases. It includes predefined classes for easy layout options, as well as powerful mixins for generating more semantic layouts.</p>
</section>
<section class="col-md-6 col-md-4">
<img class="icon" src='images/car.png' alt="Icon">
<h3>Cars</h3>
<p>Bootstrap includes a responsive, mobile first fluid grid system that appropriately scales up to 12 columns as the device or viewport size increases. It includes predefined classes for easy layout options, as well as powerful mixins for generating more semantic layouts.</p>
</section>
<section class="col-md-6 col-md-4">
<img class="icon" src='images/clothes.png' alt="Icon">
<h3>clothss</h3>
<p>Bootstrap includes a responsive, mobile first fluid grid system that appropriately scales up to 12 columns as the device or viewport size increases. It includes predefined classes for easy layout options, as well as powerful mixins for generating more semantic layouts.</p>
</section>
</div>
<div class="row">
<section class="col-md-6 col-md-4">
<img class="icon" src='images/motorcycle.png' alt="Icon">
<h3>Motorcycle</h3>
<p>Bootstrap includes a responsive, mobile first fluid grid system that appropriately scales up to 12 columns as the device or viewport size increases. It includes predefined classes for easy layout options, as well as powerful mixins for generating more semantic layouts.</p>
</section>
<section class="col-md-6 col-md-4">
<img class="icon" src='images/pet-icon.png' alt="Icon">
<h3>Pets</h3>
<p>Bootstrap includes a responsive, mobile first fluid grid system that appropriately scales up to 12 columns as the device or viewport size increases. It includes predefined classes for easy layout options, as well as powerful mixins for generating more semantic layouts.</p>
</section>
<section class="col-md-6 col-md-4">
<img class="icon" src='images/phone.png' alt="Icon">
<h3>Phone</h3>
<p>
Bootstrap includes a responsive, mobile first fluid grid system that appropriately scales up to 12 columns as the device or viewport size increases. It includes predefined classes for easy layout options, as well as powerful mixins for generating more semantic layouts.
</p>
</section>
</div>
</div>
<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/script.js"></script>
//my css code
.icon{
max-width: 150px;
margin: 0 auto;
display: block;
}
.service section{
text-align: center;
}
这段代码将如何工作?有什么更正或建议吗?
【问题讨论】:
标签: html css twitter-bootstrap-3 bootstrap-modal bootstrap-4