I am currently working on a website design using HTML and CSS and I want to position this image to fit in the page like this:
I need it to be responsive.
What I did for its part is:
HTML:
<div class="intro">
<img src="https://i.stack.imgur.com/GGDym.png" class="sensei-img">
</div>
CSS:
.intro {
width: 100vw;
height: 100vh;
position: relative;
-webkit-box-sizing: border-box;
/* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box;
/* Firefox, other Gecko */
box-sizing: border-box;
overflow: overlay;
display: flex;
flex-direction: row;
}
.intro .sensei-img {
position: absolute;
left: 5vw;
bottom: -10vh;
width: 70vw;
height: 100vh;
}
I can position the image perfectly with position:absolute;
but I can't seem to be able to make it's size responsive (I want it to retain its ratio even if the viewport changes). What should I do?