JSFiddle - React, Tailwind, and code Playground
by Soceine
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<section class="cover">
<div class="cover__overlay">
<a href="#" class="cover__link">
<img src="https://via.placeholder.com/1184x740.png" class="cover__img" alt="">
</a>
<div class="cover__intro">
<h3 class="cover__overlay-title">До Байкала<br>«на собаках»</h3>
<p class="cover__overlay-subtitle">По мотивам учебной темы о Транссибе<br>— путешествие от столицы до Байкала<br>на электричках.</p>
</div>
</div>
</section>
</body>
</html>
CSS
.cover {
}
.cover__img {
width: 100%;
height: 100%;
opacity: 70%;
}
.cover__overlay {
position: relative;
}
.cover__intro {
position: absolute;
top: 50%;
left: 50%;
transform:translate(-50%, -50%);
}
.cover__link {
color: #fff;
display: block;
}
.cover__img:hover {
transition: .2s linear;
opacity: 10%;
}
.cover__overlay-title {
font-family: 'Inter';
font-style: normal;
font-weight: 900;
font-size: 72px;
line-height: 76px;
margin: 0;
text-align: center;
padding-bottom: 32px;
}
.cover__overlay-subtitle {
font-family: 'Inter';
font-style: normal;
font-weight: 400;
font-size: 18px;
line-height: 22px;
text-align: center;
margin: 0;
}