<h1 class="hskeleton"></h1>
<h2 class="hskeleton"></h2>
<div>
<div class="photo hskeleton"></div>
</div>
body {
padding: 20px;
background-color: #121212;
}
h1 {
width: 60%;
height: 50px;
}
h2 {
height: 30px;
}
.photo {
width: 40%;
height: 250px;
float: left;
margin-right: 14px;
}
.hskeleton {
background-color: #222;
border-radius: 4px;
position: relative;
overflow: hidden;
}
.hskeleton::after {
content: "";
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
background-image: linear-gradient(270deg,
rgba(255,255,255,0),
rgba(255,255,255,.1),
rgba(255,255,255,0)
);
transform: translateX(-100%);
animation: hskeleton-loader 2s infinite;
}
@keyframes hskeleton-loader {
0% { transform: translateX(-100%); }
100% { transform: translateX(100%); }
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.