2

I wonder if it is semantically correct to use a different font weight on headings. For example, I have a h1 for a main title, I'm using h1, because I want search engines to know that this is my main title, but I don't want to use a heavy weight, I want to use a custom weight (100). Is it semantically correct to do this? Is there any other more semantically correct way to do it?

Kara
  • 6,115
  • 16
  • 50
  • 57
Andrés Orozco
  • 2,490
  • 5
  • 32
  • 48
  • 5
    If `h1` is the semantically correct tag, then you can use CSS to style it any way you want. You can even make it look like plain text, but it's still a `h1`. – Jongware Dec 09 '13 at 23:55

2 Answers2

3

There are two types of semantics that you should be concerned about.

The first are the semantics expressed explicitly by the markup. From this perspective, an H1 is an H1 no matter what it looks like. These are the semantics that are processed by user agents for various purposes (such as giving a default presentation in a browser, weighting the relative importance of different sections of text in a search engine indexer or generating a table of contents by an outliner).

The second are the semantics that the end user infers from the rendering of the content. If you were to style a heading so it looked exactly the same as a short paragraph, would the reader still be able to understand it to be a heading? Headings don't need to be bold, but they should be styled so they can be understood to be headings by someone looking at the page.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • Yeah, obviously I'm not gonna style my h1 as a normal paragraph, I know it wouldn't be readable, I want to change some things so it look different but not that different. – Andrés Orozco Dec 10 '13 at 00:05
1

It's fine to do it. Semantics is what you interpret out of it. HTML tags are provided for the usability of code. If the output is what you like it to be, then it's fine.

That's just how your H1 happens to be styled!

omar-ali
  • 507
  • 4
  • 14