0

Some people say that it's bad for SEO to style h1 using CSS and an h1 tag selector, and instead the developer has to place the h1 into a p tag so that it inherits its styles.

Is this correct, or not?

2

I've got lot's of H1 tags styled directly by css on lots of websites and pages rank on the first page of the SERPs without issue. I've had an SEO professional I respect tell me he styles his H1 tags to ensure they're readable for the user, despite being long because of keyword phrases he's targetting. His site ranks exceptionally well.

If you think about it, why would Google insist on something that flies in the face of logical clean web coding? Properly constructed html actually adds a great deal to a page's ability rank. A H1 inside a P would be confusing for the Goog-bot trying to 'make sense' of the page surely, so undesirable.

Just one thing... if you intend to 'hide' text in your H1 (ie: make it the same colour as the background) then that will be 'black-hat' and likely to get your site in to trouble. It MUST be readable for users.

  • 2
    Observing the HTML DOM model, it is possible that whatever is placed within the p tag will not be attributed to the h1 tag and the semantic value lost from the h1 tag and given to a lower value p tag and therefore a part of your confusing googlebot. What came to my mind is stuffing an elephant (h1) into a handbag (p). It does not make sense. For the record, you can always use CSS to style your header tags however you want, however, never(!), never(!), never(!) mess with a header tag. Simple is always best. Cheers!! – closetnoc Nov 17 '16 at 1:07
0

A <h1> element inside a <p> is invalid HTML so don't even think of doing that. Your SEO "expert" is ignorant of HTML rules, SEO and Google's stated values. And those stated values are that Google does not care how you style elements as long as they are not there with the intention of fooling the visitor with hidden text or other trickery.

The value of a <h1> is as a heading for the rest of the content just as much as the title of a book. It's very important to describe the overall content but what it looks like is not.

0

Checkout thousand of webpages online, and let me know if you found plain h1 tag without using CSS.

Just use chrome inspect element option, and you will see all most all website, <h1> tag are style with some css. If you don't use any css style in <h1> tag then you should note that, browser use some default css, for example font size property.

You don't need to place an <h1> tag into <p> tag, it is just SEO myth. Feel free to style your <h1> tag.

0

Some people say that it's bad for SEO to style h1 using CSS and an h1 tag selector

It's not bad at all. In fact, its multi-browser friendly, especially if you're referring to a code fragment like this for HTML:

<h1>Page title</h1>

and for CSS:

H1{color:#000;background:#FFA}

In fact, using H1 instead of a custom name saves you code space which makes bandwidth costs for all lower.

...the developer has to place the h1 into a p tag so that it inherits its styles.

P stands for Paragraph and H1 stands for 1st and most important header. Placing H1 inside P is illegal and also nonsense. I'd replace the developer asap.

If you want to style the H1 tag, you can use the code I showed above as a starting point, and for paragraph styles, you can insert inside the style declaration the padding parameter and make it equal to so many ems (electronic measurements). You can look up css padding on google for more info on the actual code that you'll need.

  • 1
    "em" does not stand for "electronic measurements". Google for the story behind where "em" came from in typography. – Rob Nov 17 '16 at 12:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.