加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

HTML – 用于放置广告的更好元素

发布时间:2020-12-14 19:40:55 所属栏目:资源 来源:网络整理
导读:当我在 Mozilla Publisher Network读到这篇文章时,我非常兴奋: 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,th
当我在 Mozilla Publisher Network读到这篇文章时,我非常兴奋:

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>用于广告?此外,是否有任何语义替代(元素或标记)?

解决方法

这是 what the spec says:

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>所以这个问题已经明确解决了.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读