NW6 | Sabella Fisseha | Module JS-3 -Programmer Humour | WEEK-3#299
NW6 | Sabella Fisseha | Module JS-3 -Programmer Humour | WEEK-3#299Sabella-8 wants to merge 2 commits intoCodeYourFuture:mainfrom
Conversation
|
| return fetch("https://xkcd.now.sh/?comic=latest") | ||
| .then((res) => { | ||
| if (!res.ok) { | ||
| throw new Error("error"); |
There was a problem hiding this comment.
Make sure your errors always give some more information about what went wrong. If you just see the text "error", you might be confused about what actually happened
| margin-bottom: 20px; | ||
| } | ||
|
|
||
| #comic-container { |
There was a problem hiding this comment.
This is a great opportunity to mention margin collapsing. Because your h1 and #comic-container have a bottom/top margin, and they are next to each other (or more technically they are 'adjacent siblings'), their margins 'collapse' into a single 20px margin.
This basically means that your margin-top isn't having any affect.
My personal preference here is to avoid margin-top and only apply margin-bottom to elements arranged vertically, so it's really clear which margins are being applied. In that case, the h1 would have a bottom margin, and the #comic-container wouldn't have any margin at all.
SpectacularLandscape
left a comment
There was a problem hiding this comment.
Looking good, Sabella! 🚀
I've left some comments if you want to dive deeper into what we covered here, but well done on a great little app!



Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer.