Css design for QR

Please log in to post a comment
Log in with GitHubCommunity feedback
- P@aseptimu
A good solution using relative units of measurement (vh and %). It is also an excellent solution to use adaptive layout for devices with a small screen.
Remarks
- Semantic HTML: Consider using more semantic HTML5 elements to structure your content. For example, the <main> element can be used to wrap the main content of the page.
- Using the center tag is not recommended. It is better to set text-align: center for the .main class
- Google Fonts Link: You've added a link to Google Fonts for the "Outfit" font but haven't correctly implemented the <link> tag. It should be something like this:
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@400;700&display=swap" rel="stylesheet">
- Image Alternative Text: It's good practice to include an alt attribute in your <img> tags. This improves accessibility for users who rely on screen readers and also serves as a placeholder if the image fails to load.
<img src="image-qr-code.png" alt="QR Code">
- Font Family Declaration: Your CSS for the font-family doesn't properly declare fallback font options. It's a good practice to include a generic font family in case the primary font isn't available. For example:
font-family: 'Outfit', sans-serif;
- Font Weight and Style: You've set font-weight and font-style in a general selector but used values (400, 700) that are not valid in this context. CSS expects a single value or a value per declaration, not a comma-separated list in this case.
font-weight: 400; /* Separate declaration for bold text where needed */
- CSS Efficiency: The .main img and media query styles for .main img repeat some properties that don't change (border-radius and padding-bottom). It's more efficient to declare such properties once outside the media query if they don't need to be overridden.
General Suggestions
Validation: Use a service like the W3C Validator to check your HTML and CSS for errors or warnings that could affect cross-browser compatibility and performance.
Marked as helpful
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord