Design comparison
Community feedback
- @LucieLuBPosted 3 months ago
Your HTML structure and the SVG implementation look good overall, but there are a few points of improvement, best practices, and feedback to enhance your code's readability, maintainability, and performance.
- Naming Consistency and Readability: Use consistent class naming throughout your code. You're mixing English and Portuguese (conteiner, aprendendo, publicacao, titulo, etc.). It's better to stick to one language for class names to maintain consistency and avoid confusion.
For example, rename:
<div class="conteiner"> <!-- Use container instead --> <div class="aprendendo"> <!-- Use learning instead --> <div class="publicacao"> <!-- Use publication instead --> Consider using more descriptive and meaningful class names in English if that's your project's language.- Semantic HTML: You are using div elements for everything, including the title and description, which reduces the semantic meaning of your HTML. To improve this, use semantic HTML tags where appropriate:
Replace the div for the title with a header or h1. Replace the description section with a p tag for paragraph content. Example:
<header class="title"><h1>HTML & CSS foundations</h1></header> <p class="description">These languages are the backbone of every website...</p>- Accessibility: Alt attributes: Always add meaningful alt text to images for accessibility. For the avatar image, you should add a proper description instead of leaving the alt attribute empty.
SVG accessibility: For your SVG graphic, consider adding aria-hidden="true" if it’s decorative and doesn't provide important information for users with screen readers. If it conveys information, add a proper title inside the <svg> tag.
Example:
<svg aria-hidden="true" ...>
- CSS Inline Styles: You have inline styles for the .attribution class. It’s generally a good practice to separate styles from HTML. Move these styles into the style.css file for better separation of concerns.
Example:
.attribution { font-size: 11px; text-align: center; }
.attribution a { color: hsl(228, 45%, 44%); }
- Optimization and Performance: Reduce SVG complexity: The SVG you are using is quite complex. If it’s decorative or not essential for understanding the page, you might want to consider optimizing it using tools like SVGOMG to reduce the size and complexity.
Avoid empty alt attributes unless an image is purely decorative.
-
Responsiveness: You already have the meta viewport tag, which is great for ensuring responsiveness, but you might need to check if your layout is responsive across different screen sizes. Consider adding media queries in your CSS to handle small screens and ensure elements like text, images, and SVGs are scaled appropriately.
-
Minor Corrections: Fix spelling issues like conteiner (should be container), and make sure to follow proper naming conventions.
Final Feedback:
Good points: The use of SVG is nice for scaling and quality, the meta tags are properly included, and the structure of the document is organized.
Areas to improve: Focus on using semantic HTML, improving accessibility, ensuring naming consistency, and separating styles from the HTML file. These changes will make the code cleaner, easier to maintain, and more scalable.
With these improvements, your code will be more efficient, accessible, and maintainable.
0
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