Design comparison
Solution retrospective
what's best practices when it comes to css organizing that might be flawed in my code? could i save my code from putting too many div tags? could i improve my use of flex box?
Community feedback
- @WebdevsonuPosted almost 2 years ago
@Valeria Castro Nice job creating NFT preview card component with HTML and CSS. You did good by making your code clean. To organize your CSS code you can use one line for each one of code. As I prefer to write each property on a separate line, and use indentation to group related rules. For example:
#content { /* css / } #content div { / css / } #content span { / css / } #content etc { / css */ } And to minimize the use of div tags you can use semantics in your HTML code. Semantic HTML is a type of a tag which is designed for specific content you can assign to like <main> tag is used for main content of your document and you can use <section> tag to add a section. For more info on semantics you can check here, (https://developer.mozilla.org/en-US/docs/Glossary/Semantics).
Marked as helpful1
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