<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div class="hoverDiv">
<div class="desc">
<h2>French Toast</h2>
<p>This delicous picture was made by Joseph Gonzalez on Unsplash</p>
</div>
</div>
<h2 class="word">Indulge!</h2>
</body>
</html>
html, body {
width: 100%;
height: 100%;
}
body {
display: flex;
align-items: center;
justify-content: center;
gap: 5%;
}
.hoverDiv {
width: 250px;
height: 250px;
border-radius: 8px;
background-image: url("https://images.unsplash.com/photo-1484723091739-30a097e8f929?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=749&q=80");
background-size: cover;
overflow: hidden;
}
.desc {
opacity: 0%;
backdrop-filter: brightness(35%);
background-image: red;
color: white;
height: 60%;
transform: translateY(85%);
transition: 0.3s;
}
.hoverDiv:hover > .desc {
opacity: 100%;
}
.word:before {
content: 'To enjoy pleasuere of';
display: block;
background-color: gray;
color: white;
font-size: 15px;
margin-left: 30px;
padding: 3px;
border-radius: 3px;
filter: opacity(0%);
transition: 0.3s;
}
.word:hover::before {
filter: opacity(100%);
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.