在HTML5中

前端之家收集整理的这篇文章主要介绍了在HTML5中前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
情节:在构建优惠券网站时,我意识到他们可以是不是页面独有的内容,但应该在< main>< article>内使用. ..here ..< /冠词GT;< /主取代.

问题:仅仅因为w3schools声明:

The content inside the element should be unique to the
document. It should not contain any content that is repeated across
documents.

但我有内容将在文章内.例如,每次例如可以通过输入其代码来使用优惠券,但只能通过转到登录页面来激活交易.
这将在我将发布的每个“优惠券”帖子中重复出现.
所以我现在尝试使用的是.

<main><article><main>Unique content</main>
<aside>A coupon can be used by entering its code but a deal can only be activated by going to landing page</aside></article></main>

但是又一次:

Note: There must not be more than one <main> element in a document.
 The <main> element must NOT be a descendent of an <article>,<aside>,<footer>,<header>,or <nav> element.

那么在< main>里面格式化UN-UNIQUE内容的最佳方法是什么?和/或< article>.

解决方法

标签应该用于将这些文章和旁边的元素分组.
<main>
    <article>
        The unique document content.
    </article>
    <aside>
        Related content for that document.
    </aside>
</main>

猜你在找的HTML5相关文章