help to place the image on the right of the html text using flex or something else
I am attaching all the html code, I do not know what to do. Please help me
I tried to do it through flex but it didn’t work out
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--=============== CSS ===============-->
<link rel="stylesheet" href="assets/css/styles.css">
<title>Responsive portfolio website - Bedimcode</title>
</head>
<body>
<!--==================== MAIN ====================-->
<main class="main">
<!--==================== HOME ====================-->
<section class="home section" id="home">
<div class="main__section">
<div class="container">
<div class="main__section-content">
<h4 class="home__section-title">Best Destinations around the world</h4>
<h1 class="home__section-desc">Travel, enjoy</br>
and live a new</br>
and full life</h1>
<p class="home__section-specific">
Built Wicket longer admire do barton vanity itself do in it. </br>
Preferred to sportsmen it engrossed listening. Park gate</br>
sell they west hard for the.
</p>
</div>
<div class="home-section-img">
<img src="assets/img/Image.png" alt="Img" class="home__section-image">
</div>
</div>
</div>
</section>
</main>
</body>
</html>
.main__section{
display: flex;
}
.home__section-title{
color: #DF6951;
font-size: 20px;
line-height: 50px;
}
.home__section-desc{
color: #181E4B;
font-size: 84px;
}
.home__section-specific{
color: #5E6282;
font-size: 16px;
padding: 30px 0 0;
font-weight: 400;
}
2
Answers
Try this: change
.main__section
in the CSS to.container
.use flex in the container and then add flex to both image and text