John Fitzpatrick
John Fitzpatrick

Reputation: 4349

Is There Any Reason to Use HX Tags When I Override All Styles Anyway?

I use <h1>, <h2>, <h3> tags for headers. But then I almost always "overwrite" pretty much all styles (font size/family/weight, margin and padding).

Given this, is there any real reason to use them, other than their somewhat informative nature (that something is meant as a heading)?

Upvotes: 0

Views: 2227

Answers (3)

Jukka K. Korpela
Jukka K. Korpela

Reputation: 201598

Heading markup is known to be significant to search engines (they give greater relative weight to text in them than copy test), though the details (including the importance of this issue) are not public information. Some screen readers and assistive software make use of heading markup, e.g. allowing “heading reading mode” and by making noticeable pauses before and after a heading. When an HTML document is opened in Microsoft Word, heading elements are recognized as headings that are used e.g. in generating a table of content. Headings are a widely known concept, so user style sheets may conceivably have settings for them, suitable for an individual user.

This description is not exhaustive, but it illustrates that for heading elements, the idea of “semantic markup” has some practical relevance.

Upvotes: 1

sandeep
sandeep

Reputation: 92793

Yes, it's a good to define heading tags in your document. There are some good reason like

It's good to describe your document

It's good for SEO also

It's good to use heading tag when a screen reader set to a scanning mode.

Read this for more http://webdesign.about.com/od/beginningtutorials/a/headings_struct.htm

Upvotes: 1

No Results Found
No Results Found

Reputation: 102745

Is there any real reason to use them, other than their somewhat informative nature

That is the ONLY reason to use them, to describe your document. That's the whole point of HTML, CSS is meant purely for styling.

There are exceptions for the non-semantic tags like div and span, but generally what you plan to do with your CSS should never affect your decisions on which tag to use to mark up your content, always use the appropriate one.

Upvotes: 5

Related Questions