init
This commit is contained in:
50
css3/06-pure-css-drawing-icons/index.html
Normal file
50
css3/06-pure-css-drawing-icons/index.html
Normal file
@@ -0,0 +1,50 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>高级CSS挑战 - 纯CSS图标</title>
|
||||
<style>
|
||||
.icon {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
position: relative;
|
||||
background: #3498db;
|
||||
border-radius: 50%;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.icon::before,
|
||||
.icon::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
background: white;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.icon::before {
|
||||
width: 20px;
|
||||
height: 2px;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.icon::after {
|
||||
width: 2px;
|
||||
height: 20px;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.icon:hover {
|
||||
transform: rotate(45deg);
|
||||
background: #2980b9;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="icon"></div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user