Design comparison
Solution retrospective
Should I use margin or padding?
Community feedback
- @petritnurediniPosted 9 months ago
Congratulations on completing your QR Code Component project! 🌟 It's fantastic to see your skills in action, crafting a clean and functional design. Here are some best practices and suggestions to further enhance your project:
-
HTML Structure and Semantics:
- Your HTML structure is clean and straightforward, which is great. Remember to add a descriptive
alt
attribute to your<img>
tag. This improves accessibility and SEO. For example,alt="QR Code for Frontend Mentor"
.
- Your HTML structure is clean and straightforward, which is great. Remember to add a descriptive
-
CSS Styling:
- The use of CSS variables for color schemes in the
:root
is a great practice for maintaining consistency and ease of future changes. - For maintainability, consider separating your CSS into an external stylesheet. This helps keep your HTML file focused solely on structure.
- Ensure consistent spacing and indentation in your CSS for better readability.
- The use of CSS variables for color schemes in the
-
Responsive Design:
- Test your component at various viewport sizes to ensure it remains visually appealing and functional. Consider using relative units like
rem
or%
for width and height to enhance responsiveness. - Use media queries to adjust the layout and font sizes for different screen sizes.
- Test your component at various viewport sizes to ensure it remains visually appealing and functional. Consider using relative units like
-
Accessibility:
- Ensure that the contrast ratio between the text and background colors meets accessibility standards, particularly for the paragraph text.
-
Margin vs. Padding:
- Use margin when you want to create space around elements, outside of any defined borders.
- Use padding when you want to create space inside the element, between the content and its border.
- For your QR code card, padding is appropriate for spacing within the card (like around the text), while margin is suitable for spacing outside the card (like separating the card from the screen's edges).
References for Further Learning:
- CSS Best Practices: MDN Web Docs - CSS
- Responsive Design: A List Apart - Responsive Design
- Accessibility Standards: Web Content Accessibility Guidelines (WCAG)
Keep pushing your boundaries and experimenting with new techniques. Your progress is impressive, and I can't wait to see what you'll create next. Remember, each project is a step forward in your development journey! Keep coding and learning! 💻🚀
Marked as helpful0 -
Please log in to post a comment
Log in with GitHubJoin 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