2

基金会前端框架提供了HTML 2 ways of representing breadcrumbs用于HTML中的面包屑的ul或nav?

<ul class="breadcrumbs"> 
    <li><a href="#">Home</a></li> 
    <li><a href="#">Features</a></li> 
    <li class="unavailable"><a href="#">Gene Splicing</a></li> 
    <li class="current"><a href="#">Cloning</a></li> 
</ul> 

而这种方式与nava元素,而不是ulli

<nav class="breadcrumbs"> 
    <a href="#">Home</a> 
    <a href="#">Features</a> 
    <a class="unavailable" href="#">Gene Splicing</a> 
    <a class="current" href="#">Cloning</a> 
</nav> 

哪种方式在语义上更合适?

+0

我认为两者都是语义上的c orrect。在说明书中,使用''

+0

@Zenith的结构 - 任何足够的理由相信他们中的一个是** **更比其他语义正确的? –

+0

那么,规范(http://www.w3.org/TR/html5/sections.html#the-nav-element)上使用

回答

0

面包屑用于标记,所以它们是标记而不是列表项。因此,从语义角度来看,第二种方法是正确的方法。

0

使用这个模式谢灵运

**

用这个微观数据的breadcrumber

**

<div class="breadcrumbs"> 
 
    <ul> 
 
    <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="home" > 
 
     <a href="index.html" title="Go to Home Page" itemprop="url"> 
 
     <span itemprop="title">Home</span> 
 
     </a> 
 
     <span>></span> 
 
    </li> 
 
    <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="category5"> 
 
     <a href="product.html" title="Product" itemprop="url"> 
 
     <span itemprop="title">product name</span> 
 
     </a> 
 
     <span>></span> 
 
    </li> 
 
    <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="category5"> 
 
     <a href=".finalproduct.html" title="final product" itemprop="url"> 
 
     <span itemprop="title">final product</span> 
 
     </a> 
 
     <span>></span> 
 
    </li> 
 
    <li class="category6"><strong>Final Product view</strong></li> 
 
    </ul> 
 
</div>

**

重要:也搜索引擎用于SEO目的像谷歌,雅虎显示在它有效的...

**

enter link description here