JSFiddle - React, Tailwind, and code Playground
HTML
<div class="hero-wrapper">
<div class="hero">
<div class="content">
<h1>Simple 2 Columns Grid</h1>
<p>A simple grid layout for your hero section</p>
<div>
<a href="#" class="button">Get started</a>
<a href="#">Learn more <span aria-hidden="true">→</span></a>
</div>
</div>
<div class="image-wrapper">
<div>
<img
src="https://images.unsplash.com/photo-1561736778-92e52a7769ef?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2670&q=80"
alt=""
width="2670"
height="1780"
/>
</div>
</div>
</div>
</div>
CSS
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: system-ui;
box-sizing: border-box;
}
a {
text-decoration: none;
color: #000;
}
.hero-wrapper {
background-color: rgb(230 240 245);
overflow-x: hidden;
font-size: clamp(1rem, 2vw, 1.25rem);
}
.hero {
align-items: center;
margin: 0 auto;
max-width: 80rem;
padding: 8vh 6vh;
display: flex;
gap: 2rem;
flex-wrap: wrap;
}
.hero .content {
flex: 1 0 min(30rem, 30vw);
max-width: 100%;
}
.hero .content h1 {
font-size: clamp(2.25rem, 4vw, 3.75rem);
line-height: 1;
font-weight: bold;
}
.hero .content > p {
font-size: clamp(1.25rem, 2vw, 1.75rem);
margin-top: 1.5rem;
}
.hero .content > div {
margin-top: 2.5rem;
display: flex;
align-items: center;
gap: 1.5rem;
}
.hero .image-wrapper {
display: flex;
flex: 1 0 min(30rem, 40vw);
}
.hero .image-wrapper > * {
flex: none;
}
.hero .image-wrapper img {
max-width: 100%;
height: auto;
width: 85vh;
}
.hero .button {
background-color: rgb(0, 119, 255);
color: #fff;
padding: .5rem 1.25rem;
border-radius: .25rem;
transition: background 155ms;
}
.hero .button:hover {
background-color: rgb(50, 169, 255);
}