Semantic element in HTML

Semantic elements are those elements who define there functions and meaning accurately. HTML5 introduces many semantic elements which are give bellow with the source codes and with their explanation, which make the code easier to write and understand for the developer as well as instructs the browser.

The article element

The article define its specific purpose like a forum post, a magazine or newspaper article, or a blog entry

Example of article

<style type="text/css">
  .h32ar{
    border: 1px solid lightgrey;
    padding: 5px;
  }
</style>
<article class="h32ar">
  <h5>Article</h5>
  <p>
  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
  tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
  quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
  consequat.
  </p>
  </article>

Output of above code

Article

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.


The aside element

The aside element is used for put data aside from the content it is placed in.

Example of aside

<style type="text/css">
  .h32ar{
    border: 1px solid lightgrey;
    padding: 5px;
  }
</style>
<aside class="h32ar">
  <h5>The aside element</h5>
  <p>
  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
  tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
  quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
  consequat.
  </p>
</aside>

Output of above code


The details element

The details element is used for highlight some detail.

Example of details

<style type="text/css">
  .h32ar{
    border: 1px solid lightgrey;
    padding: 5px;
  }
</style>
<details class="h32ar">
  <h5>The details element</h5>
  <p>
  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
  tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
  quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
  consequat.
  </p>
</details>

Output of above code

The details element

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Click on the details.


List of Semantic elements

There are some other Semantic elements defined below

figcaption

figcaption is used for caption on image etc.

figure

figure is used to define some figure.

footer

footer defines its specific purpose by use.

header

header define it's specific use.

main

main has it's own specific use.

mark

mark is used to mark some text.

nav

nav is used to make some navigations.

section

section to create some sections.

summary

summary is used to represents some summaries.

time

time is used to display time.










The Best

Comment here

If you have any query, if you want to know something about any of technical course related to computer science field, if you have any suggestion about relevant to uploaded content or if you anything wrong here (any mistake in content) than please contact us. Keep in mind, comment should be according to community guidelines.