<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="descripition" content="DesafioCSS">
<meta name="author" content="Milena Carecho">
<meta name="keywords" content="CSS">
<title>Ícone de mídia social em camadas </title>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
</head>
<body>
<ul>
<li>
<a href="#">
<span></span>
<span></span>
<span></span>
<span></span>
<span class="fa fa-facebook" aria-hidden="true"></span>
</a>
</li>
<li>
<a href="#">
<span></span>
<span></span>
<span></span>
<span></span>
<span class="fa fa-twitter" aria-hidden="true"></span>
</a>
</li>
<li>
<a href="#">
<span></span>
<span></span>
<span></span>
<span></span>
<span class="fa fa-google-plus" aria-hidden="true"></span>
</a>
</li>
<li>
<a href="#">
<span></span>
<span></span>
<span></span>
<span></span>
<span class="fa fa-linkedin" aria-hidden="true"></span>
</a>
</li>
<li>
<a href="#">
<span></span>
<span></span>
<span></span>
<span></span>
<span class="fa fa-instagram" aria-hidden="true"></span>
</a>
</li>
</ul>
</body>
</html>
HTML
格式化
支持Emmet,输入 p 后按 Tab键试试吧!
<head> ... </head>
<body>
</body>
CSS
格式化
body
{
margin: 0;
padding: 0;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
ul
{
position: relative;
margin: 0;
padding: 0;
display: flex;
}
ul li
{
position: relative;
list-style: none;
width: 60px;
height: 60px;
margin: 0 30px;
transform: rotate(-30deg) skew(25deg);
background: #ccc;
}
ul li span
{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #000;
transition: 0.5s;
display: flex !important;
align-items: center;
justify-content: center;
color: #fff;
font-size: 30px !important;
}
ul li:hover span
{
box-shadow: -1px 1px 1px rgba(0,0,0,.1);
}
ul li:hover span:nth-child(5)
{
transform: translate(40px, -40px);
opacity: 1;
}
ul li:hover span:nth-child(4)
{
transform: translate(30px, -30px);
opacity: 0.8;
}
ul li:hover span:nth-child(3)
{
transform: translate(20px, -20px);
opacity: 0.6;
}
ul li:hover span:nth-child(2)
{
transform: translate(10px, -10px);
opacity: 0.4;
}
ul li:hover span:nth-child(1)
{
transform: translate(0,0);
opacity: .2;
}
ul li:nth-child(1) span
{
background: #3b5999;
}
ul li:nth-child(2) span
{
background: #55acee;
}
ul li:nth-child(3) span
{
background: #dd4b39;
}
ul li:nth-child(4) span
{
background: #0077b5;
}
ul li:nth-child(5) span
{
background: #e4405f;
}
JS
格式化