Dear all, I am currently working on a project where I aim to achieve a layout similar to the one featured in this video. The goal is to have 3 divs aligned horizontally, with an image div positioned at the center while the other two divs contain random letters. Additionally, I need the image to maintain its aspect ratio when resizing. Is it possible to implement such flexibility using JavaScript?
Here is my current progress:
<div class="container">
<div class="text-block text-block-one">
<div class="text-wrapper">
<h1>Hello there</h1>
<h3>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat </h3>
</div>
</div>
<div class="image-block">
<div class="image-container">
<img src="https://via.placeholder.com/450x750">
</div>
</div>
<div class="text-block text-block-two">
<div class="text-wrapper">
<h3>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat </h3>
</div>
</div>
</div>
Snippet of my SCSS files:
body, html {
margin: 0;
width: 100%;
height: 100%;
box-sizing: border-box;
background: #efefef;
}
h1,h2,h3 {
margin: 0;
}
h1 {
margin-bottom: 20px;
}
img{
max-width:100%;
display: block;
margin: 0 auto;
object-fit: contain;
}
* {
box-sizing: border-box;
}
.container {
display: flex;
position: relative;
width: 100%;
margin: 0px auto;
.text-block {
width: 37.645448%;
background: #e3e3e3;
padding-top: 250px;
.text-wrapper {
margin: 0 10%;
overflow: auto;
}
}
.image-block {
.image-container {
}
}
}