@DigitaleWeltLibrary
Posted
Hey, good soluten but i have some points for improvment.
- For centering the card vertically too, you have to set up a
height
.
body {
min-height: 100dvh;
}
- Never use a fix width. If you want to make the card responsive then use the
min function
, it will always use the lower width. When the width of the screen is lower than350px
the card get a width of90dvw
. (Learn about the min function)
#container {
width: min(350px, 90dvw);
}
- Making the image responsive too. Firstly i give it a width of 90%. Then i want every side of the image the same size and therefore i use
aspect-ratio
. Lastly i center the image withmargin
. (Don´t forget thedisplay: block;
for it)
img#qr-code {
/* position: relative; */
/* margin: 17px; */
aspect-ratio: 1 / 1;
width: 90%;
margin: 1rem auto;
display: block;
}
I hope i could help you to improve your skills. 😉 Happy coding 😊