there's a whole page on that....
Yep, sometimes thing's can get jammythere's a whole page on that....
ow xDYep, sometimes thing's can get jammy![]()
<body>
<div class="imageContainer">
<img src="#" alt="#" class="image"/>
</div>
</body>
.imageContainer{
height: 100vh;
width: 100vw;
}
.image{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%)
}
.imageContainer{
height: 100vh;
width: 100vw;
display: flex;
justify-content: center;
align-items: center;
}
.image{
// Any other styling you want to apply to the image
}
confusing but tyAbsolute positioning (beginner friendly)
HTML:<body> <div class="imageContainer"> <img src="#" alt="#" class="image"/> </div> </body>
Code:.imageContainer{ height: 100vh; width: 100vw; } .image{ position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) }
Here's the CodePen: https://codepen.io/Athys/pen/JjdEoXK
Flexbox (advanced)
Code:.imageContainer{ height: 100vh; width: 100vw; display: flex; justify-content: center; align-items: center; } .image{ // Any other styling you want to apply to the image }
What is confusing you?confusing but ty
