Huddle Responsive Landing Page - BEM, Mobile First
Design comparison
Solution retrospective
Hi Everyone, Input and feedback on my code and how it can be improved will be greatly appreciated!
I did also have the following question that I couldn't figure out the answer to.
- Why is there a scrollbar where there's a slight scroll to the page where it shouldn't exist? I tried figuring it out and realized that things were overflowing from the body. From what I can tell, it seems to be because of the container div I wrapped everything with but I can't figure out what exactly I'm doing to make things overflow. Any input would be appreciated.
- I realize that I can set an overflow: hidden to the body to make it go away but it seems like a poor solution but if you think that's not the case, I'd love to hear your opinion.
Community feedback
- @fernandolapazPosted almost 2 years ago
Hi! regarding your question,
It just happens that the margin doesn't affect the position of the child relative to its parent, unless the parent has padding (or something else like border), that's normal behavior.
You can try adding a "padding-top: 1px" to the body for example (which could be counteracted with "margin-top: -1px" if you want), or use "border-top: 1px solid transparent", etc.
In any case, I would be inclined to perform these spacing using padding on the parent instead of margin on the child. I'd say it's best practice, although you can find out more about it.
Using overflow is another option as you say.
I hope it's useful. 👍
Cheers!
If this helped you please MARK IT AS HELPFUL 😀
Marked as helpful1@chuckstervPosted almost 2 years ago@fernandolapaz Hey mate, that's a bunch for your response. I will definitely try that. Cheers!
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