<aside>:側邊欄元素

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

<aside> HTML 元素代表文件中只間接相關於主要內容的部分。側邊欄常常被呈現為側邊欄或呼叫框。

嘗試一下

屬性

這個元素只包括全域屬性

使用注意事項

  • 請勿使用 <aside> 元素來標記括號中的文字,因為這種文字被視為主要內容的一部分。

範例

使用 <aside>

這個範例使用 <aside> 來標記文章中的一段落。這段落與主要文章內容只間接相關:

html
<article>
  <p>
    The Disney movie <cite>The Little Mermaid</cite> was first released to
    theatres in 1989.
  </p>
  <aside>
    <p>The movie earned $87 million during its initial release.</p>
  </aside>
  <p>More info about the movie…</p>
</article>

結果

技術摘要

內容類型 流內容章節型內容捫及內容
允許內容 流內容
標籤省略 不允許,開始和結束標籤都是必須的。
允許的父元素 任何接受流內容的元素。請注意,<aside> 元素不能是 <address> 元素的後代。
隱含的 ARIA 角色 complementary
允許的 ARIA 角色 feednonenotepresentationregionsearch
DOM 介面 HTMLElement

規範

Specification
HTML
# the-aside-element

瀏覽器相容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
aside

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

參見