2012-02-07 83 views
0

CSS: -在HTML中正确嵌套标题(H1> H2> H3)?

#sidebar .sidelink h6{ 
     margin-left: 10px; 
     padding-left: 22px; 
     padding-top: 9px; 
     color: #f1f1f1; 
     font-size: 18px; 
     margin-bottom: 10px; 
    } 

HTML: -

<div class="sidelink"> 
<h6 class="side-title"> 
      Our Products 
</h6> 
</div> 

当我试图验证上面的代码。我得到一个错误“巢标题正确(H1> H2> H3)”

如何解决这个问题?

回答

2

这意味着用h1开始你的标题,然后做h2,h3等。为了层次目的。在顶层 H2头

H1头在第二等

像一个缩进列表中有水平。

应该只是一个警告,虽然不是一个错误。

<h1>top level</h1> 
<h2>2nd level</h1> 
<h3>3rd level</h3> 
<h2>second level again</h2> 
<h3>3rd level</h3> 
<h6>3rd to 6th should be fine after 2nd</h6> 
0
.sidelink h6{ 
     margin-left: 10px; 
     padding-left: 22px; 
     padding-top: 9px; 
     color: #f1f1f1; 
     font-size: 18px; 
     margin-bottom: 10px; 
    } 

失去了包装,我没有看到它在你的榜样,你可以为你使用继承来选择它而不是类对H6失去类。