0

hello, about floating in css, I wanna know why these img&<p> margins are different.

https://code.sololearn.com/Wm0DAbzkQ6ZQ/#html I made border appeared, and I realized that the top margins of img and p are different. img is upper and p is slightly lower. Is it normal? thank you

28th Mar 2020, 4:30 PM
Goomba_duu
Goomba_duu - avatar
2 odpowiedzi
+ 1
That is because of the default margin set by html. Check thjs: https://code.sololearn.com/W4Mqg143nA59/?ref=app If you clear the default mARGIN using universal selector i.e. *, and set the custom mARGIN, you can see they will have same amount of margins at the top.
3rd Apr 2020, 7:58 AM
Bibek Oli
Bibek Oli - avatar
+ 1
thank you!
8th Apr 2020, 4:36 AM
Goomba_duu
Goomba_duu - avatar