为什么<h3>和<p>之间有这么大的空间

roo*_*era 5 html css

我不明白.为什么"标题"和"文本"之间有这么大的空间?请看一下这段代码:

 <h3 style="background:#000">Title</h3>
        <p class="d" style="background:#000">
       Text Text Text Text Text Text Text Text Text Text Text 
        </p>
Run Code Online (Sandbox Code Playgroud)

绝对没有其他样式应用于这两个元素,但仍有很多未使用的空间.有人有想法吗?

在此输入图像描述

Ron*_*Dex 7

标题标记(<h1>,, <h2>...)具有默认填充和边距应用于它们.该段也是如此<p>

如果要删除这些默认空格,请将以下样式添加到css或元素内的标题和段落中:

padding: 0; margin: 0;
Run Code Online (Sandbox Code Playgroud)


小智 6

试着给 margin:0 for h3 and p