Design comparison
Community feedback
- @MohammedOnGitPosted about 2 months ago
Hello sapWRLD!!!
Here are the suggestions for improving the HTML code based on best practices, performance, and SEO:
- Best Practices Semantic HTML:
Use semantic tags like <article>, <section>, and <header> to improve the structure. For example, the recipe content can be wrapped in <article>, and the preparation time, ingredients, and instructions can go inside <section>. Correct the class attribute for the Ingredients heading: class="#" should just be class="ingredients". Consistent Class Naming:
Use lowercase class names (e.g., Ingredients, .Instructions, and . Nutrition should be .ingredients, .instructions, .nutrition to maintain uniformity). External Links:
Add rel=" no opener no-referrer" to external links that open in new tabs for security.
- Performance Image Optimization: Use modern formats like WebP for better performance. Add the loading="lazy" attribute to the image for lazy loading.
<img src="assets/images/image-omelette.jpeg" alt="Omelette" class="image" loading="lazy">
CSS Optimization:
Consider minifying your CSS file to reduce load times. Also, consider inlining critical CSS for the first render to avoid blocking. Font Preload:
Since you’re using Google Fonts, it’s better to preload the fonts for faster performance.
<link rel="preload" href="https://fonts.googleapis.com/css2?family=Young+Serif&display=swap" as="style">
- SEO Improvements Title Tag: The title could be more descriptive for SEO purposes. Example:
<title>Simple Omelette Recipe | Quick & Easy Meal Ideas</title>
- Meta Description: Add a meta description for search engines. For example:
<meta name="description" content=" Learn how to make a simple omelette recipe. Quick and easy instructions for a nutritious meal. Perfect for any time of the day.">
- Accessibility Image Alt Text: The alt text "Omelette" could be more descriptive. Consider something like:
<img src="assets/images/image-omelette.jpeg" alt="A delicious, golden omelette served on a plate" class="image" loading="lazy">
Button and Link ARIA Labels: Consider adding ARIA labels to enhance accessibility for links and any interactive elements.
- Minor Code Improvements Remove the inline style in the
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