HTML5事件列表语义 [英] HTML5 Event Listing Semantics

查看:127
本文介绍了HTML5事件列表语义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在事件列表页面上列出每个事件为< article> 是正确的(给定每个事件是所述事件的详细信息页面中的列表如果它被认为是与博客相同的东西(语义上),也应该考虑到事件日期/时间的标记,任何引用的阅读是欢迎的,我找不到任何细节!

 < main> 
< article>事件1提供日期< / article>
< article>事件2给出日期< / article>
< article>事件3提供日期< / article>
< / main>

或者每个事件应该包含在一个文章中,并用典型的div结构包装。

 code>< article> 
< div>给定日期的事件1< / div>
< div>给定日期的事件2< / div>
< div> ;给定日期的事件3< / div>
< / article>


解决方案


  1. 使用 文章元素对于事件

    如果使用分段内容元素是有必要的。


  2. A


  3. 有意义的是,在文档大纲中列出每个事件是有意义的。列出文件大纲

    中的每个事件,如果您提供足够的内容(其中足够,当然取决于上下文)。


所以,例如



如果你只列出事件名称和日期,一个 ul 元素似乎更合适:

 < UL> 
< li>< a href =/ events / 1>事件1< / a> (小于时间> 2016年12月27日< /时间>)< /锂>
< li>< a href =/ events / 2>事件2< / a> (小于时间> 2016年12月27日< /时间>)< /锂>
< li>< a href =/ events / 3>事件3< / a> (小于时间> 2016年12月28日< /时间>)< /锂>
< / ul>

但如果您提供更多详细信息,如描述,组织者等,则 article 每个事件的元素都有意义:

  <物品> 
< header>
< h2< a href =/ events / 1 =bookmark>事件1< / a>< / h2>
< time> 2016-12-27< / time>
< / header>
< p> ...< / p>
< img src =alt =/>
< p> ...< / p>
< footer>< p>由...组织< / p>< / footer>
< / article>

< article>
<! - 事件2 - >
< / article>

< article>
<! - 事件3 - >
< / article>


Would it be correct to list each event as an <article> on an event listing page (given that each event is a listing from the detail page of said event. Should it be considered the same thing as blog (semantically). Also should there be any consideration of the event date/time when it comes to markup. Any referenced reading are welcome, I couldn't find any particulars!

<main>
 <article>Event 1 on date given</article>
 <article>Event 2 on date given</article>
 <article>Event 3 on date given</article>
</main>

or should each event be contained in a single article and wrapped with a typical div structure.

<article>
 <div> Event 1 on date given</div>
 <div> Event 2 on date given</div>
 <div> Event 3 on date given</div>
</article>

解决方案

  1. It’s appropriate to use the article element for events
    if using a sectioning content element is warranted.

  2. A sectioning content element is warranted
    if it makes sense to list each event in the document outline.

  3. It makes sense to list each event in the document outline
    if you provide enough content (where enough, of course, depends on the context).

So, for example,

if you just list the event name and the date, an ul element seems to be more appropriate:

<ul>
  <li><a href="/events/1">Event 1</a> (<time>2016-12-27</time>)</li>
  <li><a href="/events/2">Event 2</a> (<time>2016-12-27</time>)</li>
  <li><a href="/events/3">Event 3</a> (<time>2016-12-28</time>)</li>
</ul>

but if you provide more details, like a description, the organizer, etc., an article element for each event can make sense:

<article>
  <header>
    <h2><a href="/events/1" rel="bookmark">Event 1</a></h2>
    <time>2016-12-27</time>
  </header>
  <p>…</p>
  <img src="" alt="" />
  <p>…</p>
  <footer><p>Organized by …</p></footer>
</article>

<article>
  <!-- event 2 -->
</article>

<article>
  <!-- event 3 -->
</article>

这篇关于HTML5事件列表语义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆