Order Summary Component using HTML and CSS

Solution retrospective
Is my code too messy? I feel that since this project is just a one pager, I felt that it was okay for my CSS references to be put however. I assume this is bad practice and would like to ask for advice on what should be done.
Is the HTML structure of my code okay? And what improvements would you suggest?
I would also like to ask if my selector references are alright. For example, in the stylesheet, I've set properties for tags like h3 and p and was wondering if doing this will mess the whole code in anyway, especially in bigger projects?
Please log in to post a comment
Log in with GitHubCommunity feedback
- @12Kentos
Hey @mogs7,
Nice job on completing this challenge! It's looking good. :)
In response to your questions,
I think your code is organized ok, but you will definitely want to start practicing now organizing your code in a way that makes sense to you, so when you come back to it months/years later it still makes sense. An easy way to organize code, is simply to add comments to it. That way you can look at the comment and easily know what the next section/sections of code are for.
I think your html structure is fine. I didn't see any big issues with it, however I would suggest at some point looking into html naming conventions like BEM.
I would suggest in the future you avoid selecting elements directly like you did in the following code.
p{ color:hsl(224, 23%, 55%); font-size: 16px; }
This will affect every single p element you have on the page, and in bigger projects this would affect a lot of your work.
I would suggest either using a more specific selector, or better yet using a class. If you go the first route of using a more specific selector, this can lead to specificity wars, which is not a fun thing to deal with.
Here's a really good video by Kevin Powell in which he gives some good suggestions on best practices.
Let me know if you have any other questions!
Marked as helpful
Join 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