HTML semantic elements for adding custom annotation data

Suppose I have an HTML paragraph that interests me in the annotation (i.e. add some context that should not be displayed, just add meaning to the text)

<p>The ultimate measure of a man is not where he stands 
in moments of <tag data="some custom annotation">comfort and convenience</tag>,
but where he stands at times of challenge and controversy.</p>

What is the correct semantic tag to be used in this case?

+4
source share
2 answers

For this case, there is a special tag that defines semantic meaning without displaying content. This is done with the metac itempropand contentproperties tag and is well explained in the schema.org Getting Started section :

3. / :

- , - , . ( , , 4 5) Flash (, ), , (, ).

content . - 4 5 :

<div itemscope itemtype="http://schema.org/Offer">
  <span itemprop="name">Blend-O-Matic</span>
  <span itemprop="price">$19.95</span>
  <img src="four-stars.jpg" />
  Based on 25 user ratings
</div>

.

<div itemscope itemtype="http://schema.org/Offer">
  <span itemprop="name">Blend-O-Matic</span>
  <span itemprop="price">$19.95</span>
  <div itemprop="reviews" itemscope itemtype="http://schema.org/AggregateRating">
    <img src="four-stars.jpg" />
    <meta itemprop="ratingValue" content="4" />
    <meta itemprop="bestRating" content="5" />
    Based on <span itemprop="ratingCount">25</span> user ratings
  </div>
</div>

. , .

+1

HTML-, . : Microdata RDFa.

. Google Microdata.

schema.org. . HTML :

Microdata​​h2 >

<p itemscope itemtype="http://schema.org/Person">
  The ultimate measure of a man is not where he stands in moments of 
  <span itemprop="description">comfort and convenience</span>,
  but where he stands at times of challenge and controversy.
</p>

RDFa

<p vocab="http://schema.org/" typeof="Person">
  The ultimate measure of a man is not where he stands in moments of 
  <span property="description">comfort and convenience</span>,
  but where he stands at times of challenge and controversy.
</p>

, <span> . , RDFa Microdata .

, RDF Translator. .

+1

Source: https://habr.com/ru/post/1625079/


All Articles