HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<title>Hero Section</title>
</head>
<body>
<section class="hero">
<div class="left">
<h3 class="head_text">Unleash Your Inner Chess Grandmaster</h3>
<p class="body_text">
Discover the secrets of the chessboard, sharpen your
tactics, and become a true chess grandmaster. Start your
chess adventure now.
</p>
<a href="#" class="link">Learn more</a>
</div>
<div class="right">
<div class="img_container">
<img src="src/chess.jpg" alt="" class="img" />
</div>
</div>
</section>
</body>
</html>
CSS
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
text-decoration: none;
font-family: 'Roboto', sans-serif;
}
.hero{
max-width: 1280px;
width: 100%;
margin: 0 auto;
display: flex;
align-items: center;
padding: 48px 48px;
gap: 12px;
}
.left{
flex: 1;
}
.head_text{
color: #333;
font-size: 56px;
font-weight: 700;
}
.body_text{
color: #707070;
font-size: 24px;
margin: 16px 0 24px;
}
.link{
color: #000;
font-size: 20px;
font-weight: 600;
}
.link:hover{
text-decoration: underline;
}
.right{
flex: 1;
padding: 12px;
}
.img_container{
width: 100%;
aspect-ratio: 3/4;
border-radius: 24px;
overflow: hidden;
}
.img{
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
@media screen and (max-width:980px){
.hero{
flex-direction: column-reverse;
padding: 48px 24px;
gap: 24px;
}
.head_text{
font-size: 48px;
}
.body_text{
font-size: 22px;
}
.link{
font-size: 18px;
}
.right{
padding: 0;
}
}
or you can get full code in by clicking button bellow :