了解如何使用 CSS 创建"section counter"。
区域计数器用于通过显示有趣的数字来告诉人们他们的业务进展情况:
伙伴
项目
快乐的客户
会议
<div class="row">
<div class="column">
<div class="card">
<p><i class="fa fa-user"></i></p>
<h3>11+</h3>
<p>Partners</p>
</div>
</div>
<div class="column">
<div class="card">
<p><i class="fa fa-check"></i></p>
<h3>55+</h3>
<p>Projects</p>
</div>
</div>
<div class="column">
<div class="card">
<p><i class="fa fa-smile-o"></i></p>
<h3>100+</h3>
<p>Happy Clients</p>
</div>
</div>
<div class="column">
<div class="card">
<p><i class="fa fa-coffee"></i></p>
<h3>100+</h3>
<p>Meetings</p>
</div>
</div>
</div>
.* {
box-sizing: border-box;
}
/* Float four columns side by side */
.column {
float: left;
width: 25%;
padding: 0 5px;
}
.row {margin: 0 -5px;}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
/* Responsive columns */
@media screen and (max-width: 600px) {
.column {
width: 100%;
display: block;
margin-bottom: 10px;
}
}
/* Style the counter cards */
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
padding: 16px;
text-align: center;
background-color: #444;
color: white;
}
.fa {font-size:50px;}
亲自试一试 »
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!