DEV Community

[Comment from a deleted post]
Collapse
 
briandoesdev profile image
Brian Heidrich

Great content! The only part I am confused by is in the h1-h6 section you have the h# tags as "Don't Use" and span tags as "Use instead". Are they flipped or am I just misunderstanding what you meant in the preceding paragraph?

Collapse
 
melnik909 profile image
Stas Melnikov

If the h1-h6 is used not for headings then that prevents people.

In other words, the h* only for headings. If you read text in my example you hardly what section is. But if this text was heading you could do it. You would understand content that is related with the heading.

Collapse
 
dballinas profile image
DBallinas

Same question here

Collapse
 
pedromagalhaes profile image
Pedro Magalhães

Headings should be used to define hierarchy in your webpage, and should never be used for styling purposes.

Collapse
 
konstantinklima profile image
Konstantin Klima

People (especially those that use WordPress and themes) will often put whole paragraphs of text inside of a h* because their theme doesn't use classes to manipulate CSS properties, but relies on attaching those CSS properties via the h* selectors.

Meaning, for example that h1 is big and blue, while h3 is a bit smaller and yellow. So someone comes along and says "this bit of text [imagine a long sentance]" needs to be a bit larger and yellow, and they will then proceed to put that very long text (which obviously is not a heading) inside a h3 tag, just for the looks.