如何创建 - 团队展示图像页面
了解如何使用 CSS 创建响应式"组织团队"页面。
""组织团队"页面/部分通常用于列出公司的雇主,并附有指定的联系信息:
Meet The Team
Jane Doe
CEO & Founder
Phasellus eget enim eu lectus faucibus vestibulum.
example@example.com
Mike Ross
Art Director
Phasellus eget enim eu lectus faucibus vestibulum.
example@example.com
John Doe
Designer
Phasellus eget enim eu lectus faucibus vestibulum.
example@example.com
如何创建组织团队页面
步骤 1) 添加 HTML:
实例
<div class="row">
<div class="column">
<div
class="card">
<img src="img1.jpg"
alt="Jane" style="width:100%">
<div
class="container">
<h2>Jane
Doe</h2>
<p class="title">CEO
& Founder</p>
<p>Some text
that describes me lorem ipsum ipsum lorem.</p>
<p>example@example.com</p>
<p><button class="button">Contact</button></p>
</div>
</div>
</div>
<div
class="column">
<div class="card">
<img src="img2.jpg" alt="Mike" style="width:100%">
<div class="container">
<h2>Mike
Ross</h2>
<p class="title">Art
Director</p>
<p>Some text that
describes me lorem ipsum ipsum lorem.</p>
<p>example@example.com</p>
<p><button class="button">Contact</button></p>
</div>
</div>
</div>
<div
class="column">
<div class="card">
<img src="img3.jpg" alt="John" style="width:100%">
<div class="container">
<h2>John
Doe</h2>
<p
class="title">Designer</p>
<p>Some text that describes me lorem ipsum ipsum lorem.</p>
<p>example@example.com</p>
<p><button class="button">Contact</button></p>
</div>
</div>
</div>
</div>
步骤 2) 添加 CSS:
实例
/* 三列并排 */
.column {
float: left;
width:
33.3%;
margin-bottom: 16px;
padding: 0 8px;
}
/* 在小屏幕上显示彼此下方的列而不是并排 */
@media screen and (max-width: 650px) {
.column {
width: 100%;
display: block;
}
}
/* 添加一些阴影来创建卡片效果 */
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}
/* 容器内的一些左右填充 */
.container {
padding: 0 16px;
}
/* 清除浮动 */
.container::after,
.row::after {
content: "";
clear: both;
display:
table;
}
.title {
color: grey;
}
.button {
border: none;
outline: 0;
display: inline-block;
padding: 8px;
color: white;
background-color: #000;
text-align: center;
cursor: pointer;
width: 100%;
}
.button:hover {
background-color: #555;
}
亲自试一试 »