This article introduces the effect of website product display using CSS3 and shares it with you. The details are as follows: HTML code <div class="product"> <ul> <li> <div class="pro-img"> <a href="#"> <img src="images/pms_1524883847.49276938!220x220.jpg" alt=""> </a> </div> <h3><a href="#">Xiaomi TV 4A 43-inch Youth Edition</a></h3> <p class="desc">Full HD screen/ artificial intelligence voice</p> <p class="price"> <span>1499</span> yuan<del>1699</del> </p> <div class="review"> <a href="#"> <span class="msg">As good as ever, Xiaomi sentiment</span> <span class="auther">Comments from surprise</span> </a> </div> </li> </ul> </div> CSS3 Code * { margin: 0; padding: 0; } ul, ol { list-style: none; } input, button { outline: none; border: none; } a { text-decoration: none; } .clearfix::before, .clearfix::after { content: ""; height: 0; line-height: 0; display: block; visibility: hidden; } .clearfix::after { clear: both; } body { padding: 100px; background-color: #f5f5f5; } .product li { float: left; width: 234px; height: 246px; padding: 34px 0 20px; z-index: 1; margin-left: 14px; margin-bottom: 14px; background: #fff; -webkit-transition: all .2s linear; transition: all .2s linear; position: relative; } .pro-img { width: 150px; height: 150px; margin: 0 auto 18px; } .pro-img a { width: 100%; height: 100%; } .pro-img img { display: block; width: 100%; height: 100%; } .product li h3 { margin: 0 10px; font-size: 14px; font-weight: 400; text-align: center; } .product li h3 a { color: #333; } .desc { margin: 0 10px 10px; height: 18px; font-size: 12px; text-align: center; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; color: #b0b0b0; } .price { font-size: 14px; margin: 0 10px 10px; text-align: center; color: #ff6700; } .price del { color: #b0b0b0; } .review { position: absolute; bottom: 0; left: 0; z-index: 3; width: 234px; height: 0; overflow: hidden; font-size: 12px; background: #ff6700; opacity: 0; -webkit-transition: all .2s linear; transition: all .2s linear; } .review a { color: #757575; display: block; padding: 8px 30px; outline: 0; } .review a span { display: block; margin-bottom: 5px; color: #fff; } .product li:hover { -webkit-box-shadow: 0 15px 30px rgba(0,0,0,0.1); box-shadow: 0 15px 30px rgba(0,0,0,0.1); -webkit-transform: translate3d(0, -2px, 0); transform: translate3d(0, -2px, 0); } .product li:hover .review { opacity: 1; height: 76px; } Running effect diagram: The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. |
<<: Some notes on installing fastdfs image in docker
>>: Detailed description of common events and methods of html text
<br /> When we browse certain websites and s...
This article example shares the specific code of ...
Below is the code that Shiji Tiancheng uses to ca...
1. View existing modules /usr/local/nginx/sbin/ng...
1. Linux kernel driver module mechanism Static lo...
Last night I wrote an essay about the browser ren...
Ansible is a new automated operation and maintena...
Table of contents Method 1: set: It is not a data...
Today's article mainly introduces the reload ...
The purpose of using cache is to reduce the press...
Enter Alibaba vector icon library Alibaba Vector ...
In most application scenarios, we need to back up...
Table of contents Using conditional types in gene...
I searched a lot online and found that many of th...
This tutorial uses CentOS 7 64-bit. Allocate 2GB ...