Design comparison
Solution retrospective
- One thing I found difficult was sort of formatting my div elements in CSS as it what somewhat of a hassle. I also needed to know how I should tackle CSS for any HTML webpage since I prefer to go in a reasonable and manageable order. One area of code I am unsure about is the padding on the text as I used very specific padding tools for them, but I may want to se a better way of doing so. One question about best practices is how should I name my classes in each HTML element? and when should I use id?
Community feedback
- @OluwalolopePosted over 1 year ago
Hello π. My name is Monkey D. Luffy, the man who will become the future king of the piratesπ€
I wanted to congratulate you on completing the challenge. You did a great job! I just have a few suggestions for you.
- Place your CSS resets in a separate file: I noticed when going through your code that you had a lot of codes trying to remove the default padding, font sizing, margins and etc. Which is very good but I recommend you paste all those codes into a new CSS sheets and link it to your HTML. To make your code cleaner. What I personally use a CSS reset by Eric Meyer. Then I do something like this π
This is my css reset
<link rel = "stylesheet" href = "css-reset.css">
This is my own stylesheet
<link rel = "stylesheet" href = "style.css">
Please the order is very important. The css reset MUST be linked before your own personal stylesheet
- Use shorthand when writing padding and margin: Instead of writing padding-left, padding-top, padding-right, padding bottom. Just simply use padding. Let me give an example:
Instead of:
Padding-top: 20px; Padding-right: 10px; Padding-bottom: 20px; Padding-left: 20px;
You can simply right it in shorthand as:
Padding: 20px 10px 20px 20px;
so the first value you put is the top , right, bottom, left. Basically it starts at the top then moves clockwise. The same applies for margin as well. This method will make your code shorter and make you faster.
Once again Congratulations π on completing the challenge. I really hope you found this helpful π€
The One Piece is Real!!!
Happy Coding π¨βπ»π
0
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