Hello Pranav,
Congrats on completing the QR- code challenge 👏
Improve accessibility
1. Alternative text
Adding a more meaningful description to the 'alt'.
For example alt="QR code for Frontend Mentor website"
2. Semantic structure
Using the semantic HTML5 in your structure.To improve the document structure and in return improve its accessibility, consider using <header>, <main>, <article>, and <footer> elements where applicable.
For example:
<main>
<article class="card-section">
<div class="card">
<img class="image_border" src="images/image-qr-code.png" alt="QR code for Frontend Mentor website">
<div class="container">
<h1 class="content">Improve your front-end skills by building projects</h1>
<p class="content2">Scan the QR code to visit Frontend Mentor and take your coding skills to the next level</p>
</div>
</div>
</article>
</main>
Read more about accessibility here
Centering the card vertically using CSS flexbox
Read more about CSS Flexbox :
body {
background-color: var(--light-gray);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
You may then remove the margin: 50px auto from .card and remove .container{ padding-top: 10px 20px 0px 20px; (invalid property) and no usage. }
The correct form for padding property shorthand should be : padding : 10px 20px 0px 20px;
I suggest that you may reduce the size of the card and QR image as well. To make the image responsive instead of giving a fix width to it , give the width:100%; max-width:350px; height: auto;
For example :
.card { width: 350px; }
.image_border {
width: 100%;
border-radius: 40px;
padding: 20px;
max-width: 350px;
height: auto;
}
I hope these will be helpful to you 😉
Good luck going forward and happy coding 🙂