-webkit-margin adds unwanted margin on texts

前端 未结 12 1757
不思量自难忘°
不思量自难忘° 2020-11-29 02:32

This hadn\'t hit me until now (and this is not only in webkit browsers). On all texts in like p tags, h1 tags etc... there\'s an extra space over a

12条回答
  •  萌比男神i
    2020-11-29 02:45

    I was having this same problem with my

    tag. I tried setting margin:0;, but it didn't work.

    I found that I was habitually commenting out lines in my css by using //. I never noticed it because it hadn't caused any problems before. But when I used // in the line before declaring

    , it caused the browser to skip the declaration completely. When I traded out // for /**/ I was able to adjust the margin.

    Moral of this story: Always use proper commenting syntax!

提交回复
热议问题