HTML HTML Basics Structuring Your Content Sectioning Content with <article>, <nav> and <aside>

i have not understand why we use <aside><article><nag>

i have not understand why we use <aside><article><nag>

2 Answers

Andrew Poteau
Andrew Poteau
2,819 Points

For article, think of a magazine, where there are several articles on different topics within the magazine. If you took one out of the magazine and read it by itself, it would make sense on its own. So on a web page, you might use <article> if your pages have several different written pieces about different things. The <aside> tag would be something that relates to the subject matter of a section of content, but is not necessary to understanding the main content. It could be used to bring up interesting side facts or other less important information. <nav> is used for the main navigation of a web page, usually at the top. It is separate from other links on the page.

Rui Xu
Rui Xu
11,245 Points

Thanks for the sharing! It is very clear!

Frederick Bogdanoff
Frederick Bogdanoff
15,327 Points

They're semantic elements for giving proper meaning to your HTML. Semantics is the study of the meanings of words and phrases in a language. Examples of non-semantic elements would be <div> and <span>. If you wrapped all of your content in <div> and <span> tags alone, it might be kind of hard for you or others to understand. You should use semantics if you want your code to be meaningful and understandable for others.