In HTML4,every section is part of the document outline. But documents
are often not that linear. A document can have special sections
containing information that is not part of,though it is related to,
the main flow,like an advertisement block or an explanation Box.
HTML5 introduces the<aside>
element allowing such sections to not be
part of the main outline.
当我在HTML5 Doctor遇到这个问题时,我感觉自己同样骄傲:
Navigation,ads,search Boxes,blogrolls and so on are not directly
related to the article and therefore do not justify the use of an
<aside>
.
因此,经过相当多的谷歌搜索,我意识到人们的意见不一.有些人同意使用< aside>对于广告等内容,但其他内容则不然.
核心问题:我正在构建一个技术博客,从一开始,我就希望页面(包括文章)是全宽的.这使我几乎没有机会在其中放置广告(Google真的不喜欢文章内容之间的“广告”).
当我遇到<旁边>我认为我击中了一个金矿,直到我看到关于它用于广告的混合意见.
所以,问题是,知识渊博的人是否可以阐明是否可以使用< aside>用于广告?此外,是否有任何语义替代(元素或标记)?
解决方法
The aside element represents a section of a page that consists of
content that is tangentially related to the content around the aside
element,and which could be considered separate from that content.
Such sections are often represented as sidebars in printed typography.The element can be used for typographical effects like pull quotes or
sidebars,for advertising,for groups of nav elements,and for other
content that is considered separate from the main content of the page.
撇开广告在第二段中明确提及为好的事实,混淆的根源很明显.这两段略有矛盾.
第一段规定,它应该用于与主要内容切向相关并被认为是独立的内容.
我怀疑这种混淆是通过选择“旁白”名称来实现的,该名称与英语中的“切向相关”内涵,而替代方案拒绝了该元素的名称,而“侧边栏”则没有.
我不完全确定为什么“侧边栏”被拒绝,但可能它被认为过于表现和语义不足.不幸的是,在选择“旁白”时,作者引入的语义并非真正意图并且没有帮助.
幸运的是,我们在这种情况下不需要破译这个矛盾.广告被特别称为适合于< aside>所以这个问题已经明确解决了.