Design comparison
SolutionDesign
Solution retrospective
I'm always happy for some feedback.
Community feedback
- @CodeWithAlaminPosted almost 2 years ago
Hi Phuong Tranπ Great job on completing this challenge! π₯³
Here are a few suggestions for improving the code:
HTML:
- Instead of using
id
attributes to style elements, consider usingclass
attributes and applying styles with CSS. This will make the HTML easier to read and maintain, and will also make it easier to reuse styles across multiple elements. - Instead of using
img
elements to display the background patterns, consider usingdiv
elements with abackground-image
property in the CSS. This will make the HTML easier to read and will also make it easier to adjust the positioning and sizing of the background patterns.
CSS:
- Instead of using
translate
to position elements, consider using thetop
,left
,right
, andbottom
properties. This will make the styles easier to understand and will also make it easier to adjust the positioning of the elements. - Consider using the
rem
unit for font sizes and spacing, instead ofpx
. This will make the styles more flexible and easier to maintain, especially if you need to adjust the sizes for different screen sizes or languages. - Instead of using the
*
selector to apply styles to all elements, consider using more specific selectors to target only the elements that you need to style. This will make the styles more efficient and easier to maintain, as they will only apply to the elements that you intended.
Here are a few tips for writing clean and maintainable CSS:
- Use variables to store colors, fonts, and other values that are used throughout the styles. This will make it easier to update the styles and will also make the code easier to read.
- Use meaningful and descriptive class names to identify the purpose of each element. This will make the HTML easier to read and will also make the styles easier to understand.
- Use comments to document the purpose and intent of each block of styles. This will make it easier for others (or yourself) to understand the code and will also make it easier to maintain and update the styles in the future.
Overall, this is a very well done solution to the challenge. Great job!
I hope this feedback was helpful. π Keep up the good work!π
Marked as helpful0 - Instead of using
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