網(wǎng)站首頁 編程語言 正文
小米官網(wǎng)盒子陰影
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="css/index.css">
<style>
* {
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;
}
</style>
</head>
<body>
<div class="product">
<ul>
<li>
<div class="pro-img">
<a href="#">
<!-- 產(chǎn)品: 比如電腦 -->
<img src="https://img2.baidu.com/it/u=1400893503,3291252764&fm=26&fmt=auto" alt="">
</a>
</div>
<h3><a href="#">小米電視4A 43英寸青春版</a></h3>
<p class="desc">全高清屏 / 人工智能語音</p>
<p class="price">
<span>1499</span>元
<del>1699</del>
</p>
<div class="review">
<a href="#">
<span class="msg">一如既往的好,小米情懷</span>
<span class="auther"> 來自于 驚喜 的評價 </span>
</a>
</div>
</li>
</ul>
</div>
</body>
</html>
心跳動畫
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>勇敢的心</title>
<style type="text/css">
html {
height: 100%;
overflow:hidden; /*設置超出部分內(nèi)容隱藏*/
}
body {
height: 100%;
/*設置漸變背景*/
background:-webkit-linear-gradient(bottom, #fff 0%,pink 100%);
}
.chest {
width: 500px;
height: 390px;
margin:100px auto;
position: relative;
}
.chest div {
width: 220px;
height: 220px;
background-color: #f50a45;
position: absolute;
}
/*交集選擇器,設置共有樣式的*/
.left,
.right {
top: 0;
border-radius: 50%;
box-shadow: 0 0 5px 5px rgba(213, 9, 60, 0.5);
animation:beat 1s linear infinite;
}
.left {
left: 60px;
}
.right {
right: 60px;
}
.chest .side {
width: 212px;
height: 212px;
left: 50%;
top:50%;
transform: translate(-50%,-50%) scale(1) rotate(45deg);
box-shadow: 8px 8px 10px -3px rgba(213, 9, 60, 0.5);
animation:beat1 1s linear infinite;
border-radius: 0px 0px 10px 0px;
}
/*定義心跳動畫*/
@keyframes beat {
0% {
transform: scale(1) rotate(45deg);
box-shadow: 0 0 40px rgba(213, 9, 60,0.3);
}
50% {
transform: scale(1.1) rotate(45deg);
box-shadow: 0 0 40px rgba(213, 9, 60, 1);
}
100%{
transform: scale(1) rotate(45deg);
box-shadow: 0 0 40px rgba(213, 9, 60,0.3);
}
}
/*由于和我們底部盒子居中 有屬性沖突 ,所以底部盒子需要另外定義動畫*/
@keyframes beat1 {
0% {
transform: translate(-50%,-50%) scale(1) rotate(45deg);
box-shadow: 13px 13px 28px rgba(213, 9, 60,0.2);
}
50% {
transform: translate(-50%,-50%) scale(1.1) rotate(45deg);
box-shadow: 13px 13px 28px rgba(213, 9, 60, 0.3);
}
100%{
transform: translate(-50%,-50%) scale(1) rotate(45deg);
box-shadow: 13px 13px 28px rgba(213, 9, 60,0.2);
}
}
</style>
</head>
<body>
<div class="chest">
<div class="right"></div>
<div class="left"></div>
<div class="side"></div>
</div>
</body>
</html>
原文鏈接:https://blog.csdn.net/qq_36413371/article/details/120393989
相關(guān)推薦
- 2022-09-03 Python實現(xiàn)計算AUC的三種方式總結(jié)_python
- 2022-04-23 window.open打開新窗口設置顯示位置及大小
- 2023-08-16 map()函數(shù)新數(shù)組不能遍歷
- 2023-05-14 windows下vscode環(huán)境c++利用matplotlibcpp繪圖_C 語言
- 2022-09-03 Python?Pandas中DataFrame.drop_duplicates()刪除重復值詳解_p
- 2022-06-23 C#使用DLLImport調(diào)用外部DLL的方法_C#教程
- 2022-11-12 C語言內(nèi)存操作函數(shù)使用示例梳理講解_C 語言
- 2022-05-10 C++構(gòu)造函數(shù)+復制構(gòu)造函數(shù)+重載等號運算符調(diào)用_C 語言
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細win安裝深度學習環(huán)境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡單動態(tài)字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支