【问题标题】:How to reduce the padding from multiple headers tag one after the other?如何一个接一个地减少多个标题标签的填充?
【发布时间】:2020-05-07 20:22:47
【问题描述】:

我想减少 continue 标头标记之间的填充。 例如:我有带有填充 H1- 30px、H2- 28px、H3- 25px、H4- 22px、H5- 20px、H6- 18px 的标题标签

h2.Hello H2
h3.Hello H3  ----- here it h2 has 28px and h3 has 25px (28+25=53), total 53px is getting padded in between two tag.  instead i need to pad height of two tag padding value i.e., 28px   
<p>Welcome </p>
h2.Hello H2
h2.Hello H2   ----- here it h2 has 28px and h2 has 28px (28+28=56), total 56px is getting padded in between two tag.  instead i need to pad value i.e., 28px 
<p>Welcome </p>
h4.Hello H4 
H5.Hello H5   ----- here it h4 has 22px and h2 has 20px (22+20=42), total 42px is getting padded in between two tag.instead i need to pad height of two tag padding value i.e., 22px   
<p>Welcome </p>

总结:当我们一个接一个地有标题标签时,需要一个逻辑来获得CSS中两个标签中最高的值。

【问题讨论】:

  • 在 CSS 中没有逻辑可以做到这一点。你需要javascript
  • 虽然有很多填充。您可以尝试使用边距。至少那些以你想要的方式崩溃。

标签: html css css-selectors padding styling


【解决方案1】:

您可以使用 CSS 并减少填充并调整到您想要的程度。

CSS

.examplePadding{
padding-bottom: 50px
padding-top: 50px;
padding-left:50px;
padding-right:50px;
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-08-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-06
    • 1970-01-01
    • 2021-01-23
    相关资源
    最近更新 更多