+ 1
How is it possible? 🤔 (Margin-top problem)
I set margin:0; in the body and I didn't set any margin at anywhere then aslo it shows margin from top... How is it possible https://code.sololearn.com/Wi28zvET2QsF/?ref=app
4 Antworten
+ 1
Yes Mr.</CODER> you are correct... Padding of h2 create that space, when I change that to span, it would not gave that space.... By the way Thanks a lot 😇. I learnt a different things from you. Thanks for your help.
0
Change body to * in css
The margin and padding reset only applied to the body
This means the children (header and section element) of the body still had the default margin set by the browser
The browser has default settings so it's advised to calibrate the settings before you proceed with your code
0
You could also set padding:0 instead of margin:0... Padding is how big the "invisible borders (I call them)" are. If you dont set it to 0, it's still going to offset everything. I usually don't even call margin:0 because most of it can be fixed with padding:0
You should check your paddings with each element that might be causing this. You could use line-height: .5 on the text elements if you want to get more granular with it.