gpt4 book ai didi

事件列表的 HTML5 地址标签

转载 作者:行者123 更新时间:2023-11-28 03:58:03 24 4
gpt4 key购买 nike

对于事件列表,我计划使用 HTML5 Address在标记中向搜索引擎显示这是一个位置。我将在主页上显示 5 个即将举行的事件。

我是否将它放在 sectionarticle 中?

当我阅读 HTML5 规范时,它让我感到困惑,如果有人能解释如何更好地使用它。

更新了来自 Steve 的代码:

<ul>
<li>
<h3><a href="<?php echo $event['href']; ?>" title="<?php echo $event['title']; ?>"><?php echo $event['title']; ?></a></h3>
<p><?php echo $event['description']; ?>
<span class="datetime">When: <time datetime="<?php echo $event['start_date']; ?>" pubdate="pubdate"><?php echo date('d-m-Y', strtotime($event['start_date'])); ?></time></span>
<span class="location">Where: <address><?php echo $event['location']; ?></address></span></p>
</li>

最佳答案

很抱歉,但在这种情况下,您滥用了 <address>标签。它旨在提供文档作者的联系信息,而不是任意地址。

The address element represents the contact information for its nearest article or body element ancestor. If that is the body element, then the contact information applies to the document as a whole.

The address element must not be used to represent arbitrary addresses (e.g. postal addresses), unless those addresses are in fact the relevant contact information. (The p element is the appropriate element for marking up postal addresses in general.)

规范:http://dev.w3.org/html5/spec/sections.html#the-address-element

一篇有用的文章:http://html5doctor.com/the-address-element/

关于事件列表的 HTML5 地址标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6721091/

24 4 0