利用CSS3实现商品图片网格布局动画特效
代码结构
1. 引入CSS
<link rel="stylesheet" type="text/css" href="css/bootstrap-grid.min.css" />
<link rel="stylesheet" type="text/css" href="css/demo.css">
2. HTML代码
<div class="demo">
<div class="container">
<div class="row">
<div class="col-md-4 col-sm-6">
<div class="product-grid">
<a href="#" class="product-image">
<img class="pic-1" src="images/img-1.jpg">
<img class="pic-2" src="images/img-2.jpg">
<div class="discount">20% Off</div>
</a>
<div class="product-content">
<h3 class="title">Jacket</h3>
<div class="price">
<span>$45.00</span>
$36.00
</div>
<ul class="rating">
<li class="fas fa-star"></li>
<li class="fas fa-star"></li>
<li class="fas fa-star"></li>
<li class="fas fa-star"></li>
<li class="fas fa-star"></li>
</ul>
</div>
</div>
</div>
<div class="col-md-4 col-sm-6">
<div class="product-grid">
<a href="#" class="product-image">
<img class="pic-1" src="images/img-3.jpg">
<img class="pic-2" src="images/img-4.jpg">
<div class="discount">25% Off</div>
</a>
<div class="product-content">
<h3 class="title">Shorts</h3>
<div class="price">
<span>$60.00</span>
$45.00
</div>
<ul class="rating">
<li class="fas fa-star"></li>
<li class="fas fa-star"></li>
<li class="fas fa-star"></li>
<li class="fas fa-star"></li>
<li class="far fa-star"></li>
</ul>
</div>
</div>
</div>
<div class="col-md-4 col-sm-6">
<div class="product-grid">
<a href="#" class="product-image">
<img class="pic-1" src="images/img-5.jpg">
<img class="pic-2" src="images/img-6.jpg">
<div class="discount">35% Off</div>
</a>
<div class="product-content">
<h3 class="title">Women's Top</h3>
<div class="price">
<span>$80.00</span>
$52.00
</div>
<ul class="rating">
<li class="fas fa-star"></li>
<li class="fas fa-star"></li>
<li class="fas fa-star"></li>
<li class="far fa-star"></li>
<li class="far fa-star"></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="text-align:center;margin:-10px 0; font:normal 14px/24px 'MicroSoft YaHei';">
</div>
如若转载请注明出处:https://www.aoym.cn/10117.html