HTML aside element is used to display some content aside from the main content.
The aside content should be somewhat similar to the main content. The <aside>
tag is used to define an aside content.
In an Example below let’s write a code to display some content aside from the main content.
Example
<!DOCTYPE html> <html> <head> </head> <body> <h2>Display aside content.</h2> <p>crus4 is an online learning platform. Here you can learn Programming, Ethical Hacking, Networking, Cybersecurity and more for free.</p> <aside>For video tutorial you can checkout our youtube channel @crus4</aside> </body> </html>
NOTE:- We have to use CSS to style an <aside>
element, else you may not see anything special in your page.
Here we will use Internal CSS to style an <aside>
element.
<!DOCTYPE html> <html> <head> <style> aside { width: 30%; padding-left: 15px; margin-left: 15px; float: right; font-style: bold; background-color: powderblue; } </style> </head> <body> <h2>Display aside content.</h2> <p>crus4 is an online learning platform. Here you can learn Programming, Ethical Hacking, Networking, Cybersecurity and more for free.</p> <aside><p>For video tutorial you can checkout our youtube channel @crus4</p></aside> </body> </html>
aside Element is supported by almost all major browsers.
Related Posts
HTML inline and block elements