如何删除 HTML 标题元素之间的行距? [英] How to remove line spacing between HTML heading elements?

查看:23
本文介绍了如何删除 HTML 标题元素之间的行距?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个代码:

<h1> Something </h1>
<h3> Somethings </h3>
<h3> Some other things </h3>

我认为 HTML 会自动在它们之间添加 1 行间距.我希望他们没有 1 行间距,我的意思是一行一行,而不是行间距行间距.

I think HTML would automatically add 1 line spacing in between them. I would like them to just go without 1 line of spacing, line by line I mean, not line space line space.

如果不使用 <br> 元素,我怎么能做到这一点,该元素在 <h1><h3>,可能不是结构上好的 HTML 实践,也许太对了?

How could I do this without using a <br> element which is definitely unworkable in between the <h1> and <h3>, and probably not a structurally good HTML practice maybe too right?

使用 CSS 底部边距可以解决这个问题吗?

Is using a CSS bottom margin fix this?

我很抱歉问这么简单的问题,我对 HTML 和CSS,但我还在学习.提前感谢所有答案

I am sorry to ask such an easy question maybe, I am a still bit new to HTML & CSS, but I am still learning. Thx in advance for all the answers

推荐答案

h1, h3 {
     margin:0;
}

这会有所帮助

这篇关于如何删除 HTML 标题元素之间的行距?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆