around ~ 15 minutes to finish
Abhishek Buragohain
@Abhirocks889All comments
- @IThowerSubmitted over 1 year ago@Abhirocks889Posted over 1 year ago
Hello Gabriel congratulations on completing this challenge. The result looks great and responsive. Here are some suggestions in order to improve even further:
HTML:
Remove unnecessary inline styles: In the provided code, there are several inline styles applied directly to elements. It's generally recommended to separate CSS from HTML for better maintainability and reusability. Consider moving these styles to an external CSS file and use classes or IDs to target the elements.
Use semantic HTML elements: Semantic elements provide meaning and improve the structure of the document. In the given code, consider using semantic elements like <header>, <main>, <section>, <article>, and <footer> to provide a clearer structure to your document. For example, you can use a <header> element for the heading section and a <main> element to wrap the main content.
Optimize classes and IDs: Ensure that the classes and IDs used in the markup accurately reflect their purpose. This will make your code more maintainable and easier to understand. For instance, instead of using IDs like div-left and div-right, use more descriptive and meaningful names.
Utilize CSS classes for common styles: Instead of applying inline styles to multiple elements, consider creating CSS classes for common styles. This allows for better separation of concerns and reduces code duplication. For example, you can create a class for the score container and apply it to all relevant elements.
Add alt attributes to images: In the <img> tag, it's important to include the alt attribute for accessibility purposes. The alt attribute provides alternative text for screen readers and helps visually impaired users understand the content of the image.
Include a favicon: Consider adding a favicon to your website by including a <link> tag in the <head> section. This will help users easily identify your website when they have multiple tabs open.
CSS: Remove unnecessary selectors and properties: In the given code, the section selector is empty. If it's not being used, you can safely remove it. Additionally, the span-scores selector doesn't have any styles applied to it. If it's not necessary, you can remove it as well.
Consolidate styles for common elements: You can combine similar styles for elements that share common properties. For example, the padding property for #div-right can be consolidated into a single padding declaration with shorthand notation: padding: 1em 2.5em 0 2em;.
Optimize class and ID names: Ensure that the class and ID names accurately represent their purpose and are easy to understand. This helps with code readability and maintenance. Consider using more descriptive names instead of generic names like div-left and div-right.
Use consistent spacing and indentation: Maintain consistent spacing and indentation throughout your CSS code to improve readability and maintainability. For example, use consistent indentation for nested selectors and properties.
Avoid using fixed width and height values: Instead of using fixed pixel values for width and height, consider using relative units like percentages or flexbox for better responsiveness and adaptability across different screen sizes.
Add comments for clarity: Consider adding comments to your CSS code to provide explanations for specific styles or sections. This can be helpful for both yourself and other developers who may need to understand or modify the code in the future.
Overall, you've done a great job, and with these enhancements, your code will be even more polished. Keep up the good work!
0 - @PhoenixTech2003Submitted over 1 year ago@Abhirocks889Posted over 1 year ago
Hello Chiyembekezo, congratulations on completing this challenge. The result looks great and responsive. Here are some suggestions in order to improve even further:
HTML:
Indentation: While the overall indentation is consistent, it is advisable to add one more level of indentation for the content inside the <body> element. This will improve readability and make the structure clearer.
Use semantic HTML elements: Consider using semantic HTML elements to provide better structure and meaning to your code. For example, you can replace the <div class="content-container"> and <div class="content"> with appropriate semantic elements such as <header> and <main>.
Image alt text: The alt attribute for the image is currently set to "image showing gabrielle chanell perfume." It's a good practice to provide more descriptive and meaningful alternative text that accurately describes the image. If possible, include relevant keywords or details about the product.
Improve heading hierarchy: Currently, you have used a combination of <p> and <h1> tags for the heading. It would be better to use the appropriate heading tags (<h1> for the main heading and <h2> for the subheading) to maintain a logical heading hierarchy.
Include <meta name="viewport">: Consider adding a <meta> tag with the name="viewport" attribute to ensure proper rendering and responsiveness on various devices. This tag helps control the viewport dimensions and scaling.
Organize CSS file references: If you have multiple CSS files, it's helpful to organize the references by placing them in the <head> section in a logical order. For example, you can group external stylesheets before internal stylesheets or custom styles.
Add comments: Adding comments to your HTML code can be beneficial for both yourself and other developers who might work on the code in the future. Comments can provide additional context, explain certain sections, or make the code more readable.
CSS:
Consistent unit usage: In the CSS code, you're using different units for some properties. For example, in the .add class, you're using pixels (px) for padding and width, while in other places, you're using rem or omitting units altogether. It's recommended to use consistent units throughout your codebase for better maintainability. Consider using rem or % for properties like padding and width to ensure scalability and responsiveness.
Increase specificity for button:hover: To increase the specificity of the button:hover selector, you can prefix it with .button-container. This will make the selector more targeted and avoid potential conflicts with other button styles.
Consolidate flex-related properties: In the .left and .right classes, you're using flex-grow, flex-shrink, and flex-basis separately. You can simplify this by using the shorthand flex property. For example, you can replace:
flex-shrink: 1; flex-grow: 1; flex-basis: 300px;
with:
flex: 1 1 300px;
Overall, you've done a great job, and with these enhancements, your code will be even more polished. Keep up the good work!
0 - @WesSnoSubmitted over 1 year ago@Abhirocks889Posted over 1 year ago
Hello Wes, congratulations on completing this challenge. The result looks great and responsive. Here are some suggestions in order to improve even further:
HTML: Consider moving the inline styles to an external CSS file: Instead of using inline styles within the tag, it's better to move those styles to an external CSS file (styles.css). This separation of concerns will make the code easier to manage and maintain.
Use semantic HTML elements: While most of the elements used in the code are appropriate, there are a couple of instances where more semantic elements can be utilized. For example:
Instead of using <b> for emphasizing text, consider using <strong>. Instead of using <section> for the summary, consider using a more specific semantic element, such as <aside>, since the summary is not the main content of the page. Provide alternative text for images: Add descriptive alternative text (alt attribute) to the <img> elements. This will improve accessibility and ensure that users with visual impairments can understand the purpose of the images.
Consider organizing CSS classes and IDs: To enhance readability and maintainability, consider grouping related CSS classes and IDs together. This can help in understanding the structure and relationships between different elements in the CSS file.
CSS:
Group related CSS properties: Consider grouping related CSS properties together to enhance readability and maintainability. For example, in the .row:nth-child() selectors, you can group the background color and the font color properties.
Use more descriptive class names: While the class names used in the code are functional, using more descriptive class names can make the code easier to understand. For instance, instead of .row, you could use something like .score-row to better represent its purpose.
Organize color variables: Since you are using a :root selector to define custom color variables, it would be beneficial to organize them systematically. Group related colors together or sort them alphabetically to improve the maintainability and ease of navigation within the code.
Consider adding comments: Although your CSS code is generally self-explanatory, adding comments to explain certain sections or provide context can be helpful for future reference and collaboration.
Finally, you can consider adding some padding to the body so that in smaller viewports, the card is not attached to the left and right edges.
These suggestions should help improve the organization, maintainability, and scalability of your CSS code. Overall, you've done a great job, and with these enhancements, your code will be even more polished. Keep up the good work!
Marked as helpful0 - @HazemHussein14Submitted almost 2 years ago
This is my first challenge so I need your feedback, Thank you😍
@Abhirocks889Posted almost 2 years agoHello Hazem, first of all congratulations on submitting your first challenge. I am sure this is the beginning of many more to come.
Regarding the solution, here are some of my pointers:
- The design looks great. I particularly like the addition of the attribution.
- The solution is responsive too. So, that is wonderful. However, for widths <= 600px, you could consider adding some padding to the body so that the card always has some space around it. Something like:
@media (max-width: 600px) { body { padding: 20px; } }
The other main feedback is regarding semantic HTML. Generally, it is considered a better practice to use semantic elements like (section, article, header, etc.) instead of plain
div
andspan
. This is to improve accessibility. You can read more about it here: Importance of Semantic HTMLAgain, congratulations on your first solution and keep learning and growing.
Regards, Abhishek
Marked as helpful1