42
loading...
This website collects cookies to deliver better user experience
"Writing semantic markup means understanding the hierarchy of your content and how both users and machines will read it."
<p>
tag indicates that this enclosed text is a paragraph. Again, since this is both semantic and presentational, users know this is a paragraph, and browsers know how to display them. <b>
or <i>
in a text, it doesn't provide any additional meaning to the markup because they are not semantic. Instead, they define only how the text would look like.<section>
, <article>
, <footer>
, <nav>
, <aside>
, <mark>
, and <time>
. All of these semantic tags make it clearer what information is on the webpage and its importance.<div>
and <span>
tags, which give no information on what that part of the page is about. However, using semantic markup, developers can provide information to search engines, crawlers, or other developers about what that part of the page is about. <div>
tags to break your page content into meaningful parts. <header>
- This element provides introductory content for a section, article, or entire web page.<nav>
- Navigation menu links would all be placed in a <nav>
tag.<main>
- The body of a page should go in the <main>
tag. There should be only one per page.<article>
- This element represents an independent article on a web page. For example, a blog post. <section>
- The <section>
element is a way of grouping together nearby content of a similar theme. <aside>
- This element represents content that’s less important. It’s mostly used for sidebars.<footer>
- The <footer>
element is at the base of a page or section. It might include contact information and some site navigation.<nav>
and sidebars with <aside>,
a voice reader will not understand that these elements don’t belong to the main flow of the HTML document. Therefore, it will not enable the reader to skip straight to the <article>.
<h1>
tag are given more importance than those enclosed in a <p>
tag. You can use semantic markup to help search engines rank your page using the most relevant and meaningful content on the page.