是否可以去除两个居中对齐文本之间的间距?
HTML:
<div id="content2">
<p class="t1">Discover</p>
<p class="t1">Discover</p>
</div>
CSS:
#content2 {
clear: both;
overflow: auto;
}
.t1 {
font-weight: bold;
font-size:60px;
color: black;
text-align: center;
}
p {
font-size : 30px;
padding : 0;
margin : 30px;
line-height : 20px;
}
代码笔:https://codepen.io/jayvicious/pen/owNJRr
我也在改编自这个线程: Remove spacing between <p>
当我增加行高时,content2
之间的间距和 p
也增加。
我正在寻找与此类似的输出:
每次我增加行高,它也会影响第一个段落的间距<p>
和 content2
最佳答案
您能做的最好的事情就是从 p 标签中删除边距/填充并调整行高。
作为示例,请查看 https://codepen.io/anon/pen/bRGzNW
HTML:
<div id="content2">
<p class="t1">testGg</p>
<p class="t1">testgG</p>
<p class="t1">testGg</p>
</div>
CSS:
#content2 {
clear: both;
overflow: auto;
}
.t1 {
font-weight: bold;
font-size:60px;
line-height:60px;
color: black;
text-align: center;
}
p {
padding : 0;
margin : 0;
}
关于html - CSS删除行之间的间距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44352583/