@DarkstarXDD
Posted
- Remove the absolute positioning you have done. It's not a good way to center elements. Instead, give your
<body>
amin-height
of 100vh. Then useflexbox
orgrid
on the body to center the child elements. In this example I have usedflexbox
.
body {
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
- When defining the width of your container (your card in this case) use
max-width
instead ofwidth
. This allows the card/container to be responsive in smaller screen sizes. - Remove the
height
on your card. Never setheight
value for containers. Let the content inside the container decide the height of the container. - There is no need to use line breaks (
<br>
) everywhere like you have done. You don't need to specify where the sentences break. What you should do is give amax-width
property to your container and then give margin, padding and font-sizes as you need. Based on those values the browser will determine where the sentences will break. So remove all the<br>
tags you have. - Remove your
<div.content>
. It's not needed. Having the<div.card>
is enough. However you should change the<div.card>
to a<main>
tag. So your code will look like this.
<body>
<main class="card">
<div></div>
</main>
</body>
<main>
is called a landmark element. Other types of landmark elements would be<header>
and<footer>
. But they are not needed for this project. However there should always be one<main>
element in your webpage. You can read more about it here- You can give a bit more descriptive alt text for the qr code image. I would suggest something like "qr code leads to frontendmentor.io"
- No need to have a bold tag
<b>
inside your<h1>
. You can remove that.