HTML <aside> Tag
Course Recommendation:
<aside>
Definition and Usage
The tag defines some content outside the content it is in.
The content of the aside should be indirectly related to the surrounding content.<aside>
Tip:
Content is usually placed as a sidebar in the document.<aside>
Note: <aside>
The style of the element (see the following examples).
See also:
HTML DOM Reference Manual:Aside Object
Example
Example 1
Display content other than the content it is in:
<p>This summer, my family and I visited the Shanghai Haichang Ocean Park. The weather was good, and the ocean park was very dreamy! My family and I had a wonderful summer!</p> <aside> <h4>Shanghai Haichang Ocean Park</h4> <p>The Shanghai Haichang Ocean Park is a themed park located in Pudong New Area, covering an area of about 29.7 hectares, surrounded by the characteristics of ocean culture, and is also a national AAAA level tourist attraction.</p> </aside>
Example 2
Set the style of the <aside> element using CSS:
<html> <head> <style> aside { width: 30%; padding-left: 15px; margin-left: 15px; float: right; font-style: italic; background-color: lightgray; } </style> </head> <body> <h1>aside element</h1> <p>This summer, my family and I visited the Shanghai Haichang Ocean Park. The weather was good, and the ocean park was very dreamy! My family and I had a wonderful summer!</p> <aside> <p>The Shanghai Haichang Ocean Park is a themed park located in Pudong New Area, covering an area of about 29.7 hectares, surrounded by the characteristics of ocean culture, and is also a national AAAA level tourist attraction.</p> </aside> <p>This summer, my family and I visited the Shanghai Haichang Ocean Park. The weather was good, and the ocean park was very dreamy! My family and I had a wonderful summer!</p> <p>This summer, my family and I visited the Shanghai Haichang Ocean Park. The weather was good, and the ocean park was very dreamy! My family and I had a wonderful summer!</p> </body> </html>
Global attributes
<aside>
The tag also supports Global attributes in HTML.
event attributes
<aside>
The tag also supports Event attributes in HTML.
Default CSS settings
Most browsers will display the following default values <aside>
Element:
aside { display: block; }
Browser support
The numbers in the table indicate the first browser version to fully support the element.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
6.0 | 9.0 | 4.0 | 5.0 | 11.1 |