<div class="container">
<div>
<div class="content">
<h2>Jane Doe</h2>
<span>UI & UX Designer</span>
</div>
</div>
<div>
<div class="content">
<h2>Alex Smith</h2>
<span>CEO Expert</span>
</div>
</div>
<div>
<div class="content">
<h2>Emily New</h2>
<span>Web Designer</span>
</div>
</div>
<div>
<div class="content">
<h2>Lisa Boley</h2>
<span>Marketing Coordinator</span>
</div>
</div>
</div>
@import url("https://fonts.googleapis.com/css2?family=Ubuntu+Mono&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
min-height: 100vh;
display: grid;
place-items: center;
background: #100721;
font-family: "Ubuntu Mono", monospace;
font-weight: 400;
}
.container {
width: 100%;
display: flex;
justify-content: center;
height: 500px;
gap: 10px;
> div {
flex: 0 0 120px;
border-radius: 0.5rem;
transition: 0.5s ease-in-out;
cursor: pointer;
box-shadow: 1px 5px 15px #1e0e3e;
position: relative;
overflow: hidden;
&:nth-of-type(1) {
background: url("https://images.pexels.com/photos/1845208/pexels-photo-1845208.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260")
no-repeat 50% / cover;
}
&:nth-of-type(2) {
background: url("https://images.pexels.com/photos/36469/woman-person-flowers-wreaths.jpg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260")
no-repeat 50% / cover;
}
&:nth-of-type(3) {
background: url("https://images.pexels.com/photos/1468379/pexels-photo-1468379.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260")
no-repeat 50% / cover;
}
&:nth-of-type(4) {
background: url("https://images.pexels.com/photos/247322/pexels-photo-247322.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260")
no-repeat 50% / cover;
}
.content {
font-size: 1.5rem;
color: #fff;
display: flex;
align-items: center;
padding: 15px;
opacity: 0;
flex-direction: column;
height: 100%;
justify-content: flex-end;
background: rgb(2, 2, 46);
background: linear-gradient(
0deg,
rgba(2, 2, 46, 0.6755077030812324) 0%,
rgba(255, 255, 255, 0) 100%
);
transform: translatey(100%);
transition: opacity 0.5s ease-in-out, transform 0.5s 0.2s;
visibility: hidden;
span {
display: block;
margin-top: 5px;
font-size: 1.2rem;
}
}
&:hover {
flex: 0 0 250px;
box-shadow: 1px 3px 15px #7645d8;
transform: translatey(-30px);
}
&:hover .content {
opacity: 1;
transform: translatey(0%);
visibility: visible;
}
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.