Html5 <aside> tag

When using the <aside> in HTML 5, do we need to add the float:right (or left ) attribute? Because most of the time I used it as a sidebar.

This is a basic question, but I just want to find the right way to use it.

+4
source share
2 answers

You do not need to add anything. HTML is a language that defines the structure of a document. You should choose HTML tags based on their semantic meaning, not how they should be displayed, what CSS is for.

You would use the <aside> , where the content contained inside is auxiliary to the main content of the page.

To understand my explanations in more detail, <div> , <header> , <footer> , <main> , <article> , <nav> , <aside> and <section> all rendered in the same way, but they differ significantly in semantic meaning.

+10
source

The aside element is not called, so due to positioning it gets this name in order to be intended for the content of secondary content. It can be created in any way, but it should be placed semantically in your DOM based on its contents.

Read the excellent article here in the Html5Doctor for further explanation.

+3
source

Source: https://habr.com/ru/post/1435403/


All Articles