Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please type your username.

Please type your E-Mail.

Please choose an appropriate title for the post.

Please choose the appropriate section so your post can be easily searched.

Please choose suitable Keywords Ex: post, video.

Browse

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Navigation

  • Home
  • About Us
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Contact Us
Home/ Questions/Q 5147

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Latest Questions

Author
  • 61k
Author
Asked: November 27, 20242024-11-27T06:33:07+00:00 2024-11-27T06:33:07+00:00

HTML Page Structure & Semantics

  • 61k

Hey coders

We come across different website designs every day and almost every one of them has a different structure which is defined by positioning HTML's grouping elements in different ways.

HTML Page Structure

You can see The most basic structure that we come across on the web in this image.
HTML Page Structure
The elements in the given picture are the thematic grouping elements or we can say semantic elements that we use to structure our page. Let's go through these one by one –

  • header – This element is used for the introductory purpose we usually contain our logo, nav menu, etc. inside this element.
  • main – The main element is used to hold all the meaningful content of the page that we want our visitors to go through i.e, all the section, article, aside tags come inside it. NOTE: There should only be one main element in an HTML document.
  • section – Section is used to group associated content such as different articles, information cards, etc.
  • article – We use an article when there's a piece of content on our page that is independent of other content on our web page. for example, a blog post or a news story, etc. The article tag is contained in the section tag.
  • aside – aside is the element used to contain the sidebars on our page.
  • footer – Footer is used for containing content like copyright information, site links, newsletter forms, etc.

One thing to note here is that the footer and header can be kept inside the main element also but one could argue that these should be outside the main as they usually don't hold content that is directly related to the central topic of our document. So we should try to use them only as a descendent of section, article or any other element while using them inside the main element. Whereas, the header and footer of the whole website should be kept outside the main element.

HTML Semantics

Now, you must be thinking we can use a <div> rather than using any of these elements to make any possible style,and it's correct too but this is also where the necessity of using semantics and semantic elements come into play.

What is semantics?

Semantics in terms of HTML simply means describing the meaning of our given content to the browser and ourselves(the developers). The generic elements we discussed above do just that. For example, using a <table> tag to define a table for our page instead of a <div>, <article> or <section> provides better semantics as it clearly defines that there's a table here.

Why not use <div> instead

So we know the meaning of semantics now and how they provide meaning to our content let's come back to the question of why can't we use <div>, <span>, etc. for these purposes. The answer is simple the sole purpose of a <div> is for grouping and styling our content but not to provide semantic meaning to our page. <div> does not provide any meaningful information regarding the type of content to the browser or the developer himself.
So, <div> has its use case and that is the grouping and then styling the content.

Benefits of using Semantic tags

These are some key benefits of semantic tags that you should know in case you are about to avoid using them

  • Clear indication of the role played by our content
  • Better readability of code
  • Offer SEO benefits
  • Better consistency with the new HTML5 specifications

Semantic tags are for containing the content so that it provides some meaningful information about itself and you should try to avoid using them for styling purposes whereas, <div> is for styling the content that we have inside our semantic elements.

Thanks for reading the article ✌️.

beginnershtmltutorialwebdev
  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

Stats

  • Questions 4k
  • Answers 0
  • Best Answers 0
  • Users 2k
  • Popular
  • Answers
  • Author

    ES6 - A beginners guide - Template Literals

    • 0 Answers
  • Author

    Understanding Higher Order Functions in JavaScript.

    • 0 Answers
  • Author

    Build a custom video chat app with Daily and Vue.js

    • 0 Answers

Top Members

Samantha Carter

Samantha Carter

  • 0 Questions
  • 20 Points
Begginer
Ella Lewis

Ella Lewis

  • 0 Questions
  • 20 Points
Begginer
Isaac Anderson

Isaac Anderson

  • 0 Questions
  • 20 Points
Begginer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore, ask, and connect. Join our vibrant Q&A community today!

About Us

  • About Us
  • Contact Us
  • All Users

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Help

  • Knowledge Base
  • Support

Follow

© 2022 Querify Question. All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.