Let your HTML wear a dress !

Ayush Singh
2 min readApr 20, 2020
novice developer ignoring HTML dressing.

I found that <div> and <span> tag can wrap up any section I want. Now if I want to create a page, I will use these tags as my containers and sub-containers and just create some meaningful class attributes to style elements . My job is done! Right ?

Is it Really done? The answer would be NO!!!!!

Why?

Your HTML is the skeleton of what you render, that does not mean that we can leave it undressed. Here dressing does not refer to styling the html but structuring and using correct tags for the demanding work.

Tags that should be used instead/along with div and span are as follows :-

<main> :- This tag can be used as a container to hold all the main/important information .

<section> :- If the webpage has got segments like introduction, mail, contact information,they can be wrapped under section tag. This tag is used just for having better semantics.

Example of using section (Ref:- https://stackoverflow.com/questions/7183132/how-to-correctly-use-section-tag-in-html5)

<header> :- This tag is used to contain the heading of your document. This is a very special tag as the headings used under it are supposed to be vibrant and appealing. Here is link that gives perfect typography scale ratios for all the heading tags from 1 to 6 https://type-scale.com.

<nav> :- This tag should contain all the navigation links like Home, About, etc.

The links to HTML, CSS, JAVASCRIPT,PHP can be put under <nav>….</nav>

<footer> :- This tag is like a footprint you leave, your contact details, copyright information, link to top of the page can be put here in this tag.This tag makes sense only if it is the last tag in your body

The reason to go for these tags as well in your html is , to improve readability, and if any other developer reads your code, he will bless you :P

Let me know if you know any other replacements and useful tags. Also feel free to correct me if I mentioned anything wrong.

--

--