卡片展示效果
今天复习了CSS的内容,就写点CSS的吧!
1、效果图
2、思路
综合用css的知识、、、
animation啊、弹性布局啊、ul的排列啊、文字的变换啊
3、代码
<div class="pricing-table">
<div class="col">
<div class="table">
<h2>Regular</h2>
<div class="price">
$10
<span>Per Month</span>
</div>
<ul>
<li><strong>2 </strong>Website</li>
<li><strong>10 </strong>Emails</li>
<li><strong>100GB </strong>Storage</li>
<li><strong>1 </strong>Account</li>
</ul>
<a href="#">Buy Now</a>
</div>
</div>
<div class="col">
<div class="table">
<h2>Regular</h2>
<div class="price">
$10
<span>Per Month</span>
</div>
<ul>
<li><strong>2 </strong>Website</li>
<li><strong>10 </strong>Emails</li>
<li><strong>100GB </strong>Storage</li>
<li><strong>1 </strong>Account</li>
</ul>
<a href="#">Buy Now</a>
</div>
</div>
<div class="col">
<div class="table">
<h2>Regular</h2>
<div class="price">
$10
<span>Per Month</span>
</div>
<ul>
<li><strong>2 </strong>Website</li>
<li><strong>10 </strong>Emails</li>
<li><strong>100 GB </strong>Storage</li>
<li><strong>1 </strong>Account</li>
</ul>
<a href="#">Buy Now</a>
</div>
</div>
<div class="col">
<div class="table">
<h2>Regular</h2>
<div class="price">
$10
<span>Per Month</span>
</div>
<ul>
<li><strong>2 </strong>Website</li>
<li><strong>10 </strong>Emails</li>
<li><strong>100 GB </strong>Storage</li>
<li><strong>1 </strong>Account</li>
</ul>
<a href="#">Buy Now</a>
</div>
</div>
</div>
body{
margin: 0;
padding: 0;
background-image: url("../img/6.jpg");
background-size: cover;
background-attachment: fixed;
}
.pricing-table{
max-width: 1200px;
margin: auto;
display: flex;
text-align: center;
flex-wrap: wrap;
}
.col{
flex: 25%;
padding: 10px;
max-width: 320px;
box-sizing: border-box;
}
.table{
background: #fff;
padding: 40px 20px;
font-family: "montserrat",sans-serif;
overflow: hidden;
box-shadow: 0 0 10px #00000070;
}
.table h2{
text-transform: uppercase;
}
.table ul{
margin: 0;
padding: 0;
}
.table ul li{
padding: 10px 0;
list-style: none;
}
.price{
font-size: 40px;
margin-bottom: 20px;
}
.price span{
display: block;
font-size: 14px;
}
.table a{
text-decoration: none;
color: #2c3e50;
border: 2px solid #2c3e50;
display: block;
padding: 10px 0;
margin: 10px 0;
border-radius: 40px;
text-transform: uppercase;
font-size: 14px;
transition: 0.5s linear;
}
.table a:hover{
background-color: #2c3e50 ;
color: #fff;
}
.pop{
background: #2c3e50;
color: #fff;
transform: rotate(45deg);
padding: 10px 40px;
position: absolute;
top: 20px;
right: -34px;
}
@media screen and (max-width:980px){
.col{
flex:50%;
}
}
@media screen and (max-width:700px){
.col{
flex:100%;
}
}