How to remove space at top of <p> tag / align contained text to top of container?

心已入冬 提交于 2019-12-01 20:42:31

It might be to accommodate accented characters, try putting Ä into the first <p>, the extra space helps accommodate the accent. That said, I'm not 100% convinced that is the definitive reason.

You can always specifically target the first line of a <p> element to reduce it using:

p::first-line {
    line-height: 0.8em;
}

Though granted, that doesnt solve the 'why' issue.

Like ExtPro has said, it's to accommodate accented characters. A simple work around is to have margin-top:-<number>px; so that you manually align it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!