在HTML 5中,Microformats vCard仍然是编码“联系信息”的最佳语义方式吗?

时间:2021-10-12 18:02:41

Is Microformats still a best semantic way to code contact information in a web page?

微格式仍然是编写网页中联系信息的最佳语义方式吗?

在HTML 5中,Microformats vCard仍然是编码“联系信息”的最佳语义方式吗?

I asked this question almost 2 years ago and got the answer where Microformat was the best solution. What is the best method to code physical address in html?

我差不多2年前问过这个问题,得到了Microformat最好的解决方案。在html中编写物理地址的最佳方法是什么?

Now today in HTML 5, Is that still the best way?

现在在HTML 5中,这仍然是最好的方式吗?

<div class="vcard">
  <span class="fn">Gregory Peck</span>
  <a class="org url" href="http://www.commerce.net/">CommerceNet</a>
  <div class="adr">
    <span class="type">Work</span>:
    <div class="street-address">169 University Avenue</div>
    <span class="locality">Palo Alto</span>,  
    <abbr class="region" title="California">CA</abbr>  
    <span class="postal-code">94301</span>
    <div class="country-name">USA</div>
  </div>
  <div class="tel">
   <span class="type">Work</span> +1-650-289-4040
  </div>
  <div class="tel">
    <span class="type">Fax</span> +1-650-289-4041
  </div>
  <div>Email: 
   <span class="email">info@commerce.net</span>
  </div>
</div>

2 个解决方案

#1


12  

It's a little bit different in HTML5, but builds on the same concept. See:

它在HTML5中有点不同,但建立在相同的概念上。看到:

#2


3  

Here is the "conversion" form that I am using, if it helps. (The first couple of sites I forgot the html5 doc tag, and spent an hour trying to find out why it wasn't working, the document elements aren't recognized if the doc type is wrong, duh!)

这是我正在使用的“转换”表单,如果有帮助的话。 (前几个网站我忘记了html5 doc标签,并花了一个小时试图找出它无法正常工作的原因,如果doc类型错误,则无法识别文档元素,呃!)

<div itemscope itemtype="http://data-vocabulary.org/Organization"> 
    <h2 itemprop="name">Heading2</h2>
    TEXT text text

    <div itemprop="address" itemscope itemtype="http://data-vocabulary.org/Address">
        <span itemprop="street-address">12345 test way </span>, 
        <span itemprop="locality">Testville</span>, 
        <span itemprop="region">TS</span> 
        <span itemprop="postal-code">00000</span>
    </div>
    <span itemprop="geo" itemscope itemtype="http://www.data-vocabulary.org/Geo/" style="display:none"><!—Don’t display in UI-->
        <span itemprop="latitude">11.1111 N</span>  
        <span itemprop="longitude">11.1111 W</span>  
    </span>  
    <p>Call us at:</p> 
    <span itemprop="tel">555-555-5555</span>
    <div>
        <a href="http://www.blahblahbla.com" itemprop="url"> http://www.blahblahbla.com</a>
    </div>
</div>

(Citation).

(引文)。

#1


12  

It's a little bit different in HTML5, but builds on the same concept. See:

它在HTML5中有点不同,但建立在相同的概念上。看到:

#2


3  

Here is the "conversion" form that I am using, if it helps. (The first couple of sites I forgot the html5 doc tag, and spent an hour trying to find out why it wasn't working, the document elements aren't recognized if the doc type is wrong, duh!)

这是我正在使用的“转换”表单,如果有帮助的话。 (前几个网站我忘记了html5 doc标签,并花了一个小时试图找出它无法正常工作的原因,如果doc类型错误,则无法识别文档元素,呃!)

<div itemscope itemtype="http://data-vocabulary.org/Organization"> 
    <h2 itemprop="name">Heading2</h2>
    TEXT text text

    <div itemprop="address" itemscope itemtype="http://data-vocabulary.org/Address">
        <span itemprop="street-address">12345 test way </span>, 
        <span itemprop="locality">Testville</span>, 
        <span itemprop="region">TS</span> 
        <span itemprop="postal-code">00000</span>
    </div>
    <span itemprop="geo" itemscope itemtype="http://www.data-vocabulary.org/Geo/" style="display:none"><!—Don’t display in UI-->
        <span itemprop="latitude">11.1111 N</span>  
        <span itemprop="longitude">11.1111 W</span>  
    </span>  
    <p>Call us at:</p> 
    <span itemprop="tel">555-555-5555</span>
    <div>
        <a href="http://www.blahblahbla.com" itemprop="url"> http://www.blahblahbla.com</a>
    </div>
</div>

(Citation).

(引文)。