<div id="wrap">
<div class="center">
<div class="section">
<div id="titled">
<div class="titled" data-title="title#1">Title#1</div>
<div class="titled" data-title="title#2">Title#2</div>
<div class="titled" data-title="title#3">Title#3</div>
<div class="titled" data-title="title#4">Title#4</div>
<div class="titled" data-title="title#5">Title#5</div>
</div>
</div>
</div>
</div>
// autoprefixer: true
html,
body {
margin: 0;
padding: 0;
font-family: sans-serif;
font-size: 16px;
line-height: 1.4;
color: #555;
background: #fff;
}
* {
box-sizing: border-box;
}
#wrap {
position: relative;
padding-top: 60px;
transition: padding-top .3s ease;
}
.section {
padding: 40px;
}
.center {
width: 100%;
max-width: 1200px;
margin: auto;
}
#titled {
display: flex;
}
.titled {
position: relative;
padding: 10px 20px;
margin: 5px;
background: #eee;
cursor: default;
&::before {
position: absolute;
z-index: 9;
top: 100%;
left: 100%;
margin: -10px 0 0 -20px;
padding: 5px 10px;
background: #fff;
box-shadow: 0 5px 10px fade(#000, 20%);
content: attr(data-title);
transition: .2s ease;
transition-property: opacity, visibility;
opacity: 0;
visibility: hidden;
pointer-events: none;
animation: showTitles 5s linear;
@keyframes showTitles {
0%, 90% {
visibility: visible;
opacity: 1;
}
100% {
visibility: hidden;
opacity: 0;
}
}
}
&:hover {
&::before {
opacity: 1;
visibility: visible;
}
}
}
View Compiled
This Pen doesn't use any external CSS resources.