Znacznik HTML <aside>
Przykład
Wyświetlaj niektóre treści poza treścią, w której są umieszczone:
<p>My family and I visited The Epcot center this summer. The weather was
nice, and Epcot was amazing! I had a great summer together with my
family!</p>
<aside>
<h4>Epcot Center</h4>
<p>Epcot is a theme
park at Walt Disney World Resort featuring exciting attractions,
international pavilions, award-winning fireworks and seasonal special
events.</p>
</aside>
Więcej przykładów „Wypróbuj sam” poniżej.
Definicja i użycie
Tag <aside>
definiuje pewną treść poza treścią, w której jest umieszczony.
Treść na uboczu powinna być pośrednio związana z otaczającą treścią.
Porada: Treść <aside>
jest często umieszczana jako pasek boczny w dokumencie.
Uwaga: element <aside>
nie jest renderowany jako nic specjalnego w przeglądarce. Możesz jednak użyć CSS do stylizacji <aside>
elementu (patrz przykład poniżej).
Obsługa przeglądarki
Liczby w tabeli określają pierwszą wersję przeglądarki, która w pełni obsługuje dany element.
Element | |||||
---|---|---|---|---|---|
<aside> | 6.0 | 9.0 | 4.0 | 5.0 | 11.1 |
Atrybuty globalne
Znacznik <aside>
obsługuje również atrybuty globalne w HTML .
Atrybuty wydarzenia
Tag <aside>
obsługuje również Atrybuty Zdarzeń w HTML .
Więcej przykładów
Przykład
Użyj CSS, aby nadać styl elementowi <aside>:
<html>
<head>
<style>
aside {
width: 30%;
padding-left: 15px;
margin-left: 15px;
float: right;
font-style: italic;
background-color: lightgray;
}
</style>
</head>
<body>
<h1>The aside element</h1>
<p>My family and I visited The Epcot
center this summer. The weather was nice, and Epcot was amazing! I had a great
summer together with my family!</p>
<aside>
<p>The Epcot center is a
theme park at Walt Disney World Resort featuring exciting attractions,
international pavilions, award-winning fireworks and seasonal special
events.</p>
</aside>
<p>My family and I visited The Epcot center
this summer. The weather was nice, and Epcot was amazing! I had a great summer
together with my family!</p>
<p>My family and I visited The Epcot center
this summer. The weather was nice, and Epcot was amazing! I had a great summer
together with my family!</p>
</body>
</html>
Powiązane strony
Odniesienie HTML DOM: Obiekt z boku
Domyślne ustawienia CSS
Większość przeglądarek wyświetla <aside>
element z następującymi wartościami domyślnymi:
aside {
display: block;
}