@kenyontu
Posted
For responsive design you can use media queries. And to use alternative versions of an image for different screens, take a look at the <picture> element.
One way to center vertically is to add a minimum height and use Flexbox on the parent element:
<body>
<div class="box" />
</body>
body {
min-height: 100vh;
display: flex;
align-items: center;
}
.box {
width: 100px;
height: 100px;
margin: 0 auto;
border: 1px solid black;
}
Marked as helpful
@schwalbj
Posted
@kenyontu Thank you, Kenyon! The picture element is indeed new for me, I will have a look! :)