哪个语义HTML标签用于显示旁注和警告?

前端之家收集整理的这篇文章主要介绍了哪个语义HTML标签用于显示旁注和警告?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在编写一个带有侧面注释的在线教程,或者他们称之为“admonitions”,类似于Django教程中的那些:
https://docs.djangoproject.com/en/dev/intro/tutorial01/(我的意思是带有绿框的框和一个音符图标).

我应该使用哪个HTML标记来附加这些注释,以添加注释的语义含义,这对于在教程的给定点读取可能很有用,但不是主要教程流程的一部分?

值得注意的是,标签必须允许封闭块元素.

解决方法

在HTML5中(由所有现代浏览器支持),标签放在一边.

http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html#the-aside-element开始:

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.

It’s not appropriate to use the aside element just for parentheticals,
since those are part of the main flow of the document.

这是一个块级元素,并且通常可以包含任何块级元素(即几乎任何东西).它本质上是一个“语义div”.

猜你在找的HTML相关文章