H1没有任何风格,但是h2,h3,...... h6

时间:2017-03-07 13:58:55

标签: html css3 tags

我使用Skeleton V2.0.4创建着陆页,但由于某种原因,我的风格并不合适。这些是唯一引用它的行:



/* Typography
–––––––––––––––––––––––––––––––––––––––––––––––––– */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: 2rem;
  font-weight: 300; }
h1 { font-size: 8.0rem; line-height: 1.2;  letter-spacing: -.1rem; }
h2 { font-size: 3.6rem; line-height: 1.25; letter-spacing: -.1rem; }
h3 { font-size: 3.0rem; line-height: 1.3;  letter-spacing: -.1rem; }
h4 { font-size: 2.4rem; line-height: 1.35; letter-spacing: -.08rem; }
h5 { font-size: 1.8rem; line-height: 1.5;  letter-spacing: -.05rem; }
h6 { font-size: 1.5rem; line-height: 1.6;  letter-spacing: 0; }

/* Larger than phablet */
@media (min-width: 550px) {
  h1 { font-size: 5.0rem; }
  h2 { font-size: 4.2rem; }
  h3 { font-size: 3.6rem; }
  h4 { font-size: 3.0rem; }
  h5 { font-size: 2.4rem; }
  h6 { font-size: 1.5rem; }
}

<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
&#13;
&#13;
&#13;

当我在Safari或Chrome中运行时,它看起来像这样:

enter image description here

发生了什么事?

2 个答案:

答案 0 :(得分:0)

这是一个野蛮的&#34;这样做但尝试

h1 { 
 font-size: 8.0rem!important;
 line-height: 1.2!important; 
 letter-spacing: -.1rem!important;
 }

也许其他一些css文件会覆盖你当前的东西。

答案 1 :(得分:0)

我解决了它,但仍然不知道为什么会发生这种情况。

我检查了它,唯一可能的区别是我的html有另一个css样式表链接到它,虽然它是完全空(严重的是,根本没有行!)。删除链接后,标签开始正常工作。

它已经解决了,虽然我仍然不知道为什么它只影响而不是麻烦的标题标签。可能有错误吗?

相关问题