如何缩短 html 中的分界线高度?

how do you shorten a breaks line height in html?

我正在尝试使用以下代码为我的假网页创建一个好的标题:

<br>  
<h1>Adults For Kids</h1>  
<h2>Bring hope to those with none</h2>  
<br>  

但是当它运行时,文本周围有太多 space,当没有中断时,空白就不够 space 那么如何缩短 space 中的中断行高度=16=]?

<br>  
<h1>Adults For Kids</h1>  
<h2>Bring hope to those with none</h2>  
<br>

目前 <br> 不影响 <h1><h2> 之间的 space,它需要在两个元素之间,像这样:-

<h1>Adults For Kids</h1>
<br>  
<h2>Bring hope to those with none</h2>

或者您可以使用 padding 示例:-

<h1 style="padding-bottom:2px">Adults For Kids</h1>
<h2>Bring hope to those with none</h2>

padding-bottompadding-toppadding-leftpadding-right

如果您希望 space 在 <h1> 和页面顶部之间,您可以这样做:-

<h1 style="padding-bottom:2px; padding-top:5px">Adults For Kids</h1>
<h2>Bring hope to those with none</h2>

因为 HTML 的每个标签都带有自己的默认属性,例如边距和填充。 您可以使用 Meyer reset 将所有内容设置为默认值。

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
 margin: 0;
 padding: 0;
 border: 0;
 font-size: 100%;
 font: inherit;
 vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
 display: block;
}
body {
 line-height: 1;
}
ol, ul {
 list-style: none;
}
blockquote, q {
 quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
 content: '';
 content: none;
}
table {
 border-collapse: collapse;
 border-spacing: 0;
}

将其放入您的 CSS 代码中,所有内容都将设置为默认值,例如标题和段落的所有边距和填充以及其中的 line-heights。您应该指定所有自定义 CSS.