【问题标题】:Weird spacing below single lined h3单行h3下方的奇怪间距
【发布时间】:2019-04-23 00:28:20
【问题描述】:

我的<h3> 元素在一行时有一些奇怪的空白。当它超过一行时,没有间距。附上图片。

h1,
h2,
h3,
h4,
h5,
h6 {
  color: #519B96;
  line-height: 1!important;
  margin: 0 0px 25px;
}

h3 {
  font-size: 30px!important;
  margin: 40px 0 -10px;
  text-align: left;
}

.teal {
  color: #519B96!important;
}
<h3 class="teal">«Les Lettres persanes» (1721)</h3>
<p class="p1">
  “Les Lettres persanes”, roman qu’il publie dans l’anonymat à Amsterdam en 1721
</p>

【问题讨论】:

  • 请附上演示您的问题的html和css。
  • 你能添加你的html和css最小代码sn-p
  • 好的,这里是 HTML

    «Les Lettres persanes» (1721)

    “Les Lettres persanes”, roman qu' il publie dans l'anonymat à Amsterdam en 1721

    "> CSS h1, h2, h3, h4, h5, h6 { color: #519B96; line-height: 1!important; margin: 0 0px 25px; } h3 {字体大小:30 像素!重要;边距:40 像素 0 -10 像素;文本对齐:左;} .teal { 颜色:#519B96!重要;}
  • 你还用不同的字体得到那个间距吗?
  • 是的,不同字体也有同样的问题。

标签: html css spacing


【解决方案1】:

你来了

h1, h2, h3, h4, h5, h6 { 
            color: #519B96; 
            line-height: 1!important; 
            margin: 0 0px 25px; } 

  h3 { 
   font-size: 30px!important;  
   margin: 40px 0 -10px;  
   text-align: left; 
   background-color: red;} 

  .teal { 
     color: #519B96!important; }
<h3 class="teal">«Les Lettres persanes» (1721)</h3> 
   <p class="p1">
     “Les Lettres persanes”, roman qu’il publie dans l’anonymat à Amsterdam 
      en 1721
</p> 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-10-14
    • 1970-01-01
    • 1970-01-01
    • 2012-03-28
    • 1970-01-01
    • 2012-05-15
    • 1970-01-01
    • 2013-02-17
    相关资源
    最近更新 更多