Mobile app version of vmapp.org
Login or Join
Cofer257

: Do you need to place an 'h1' into a 'p' tag in order to style it so it won't hurt your SEO? Some people say that it's bad for SEO to style h1 using CSS and an h1 tag selector, and instead

@Cofer257

Posted in: #Css #Html #Seo

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?

10.04% popularity Vote Up Vote Down


Login to follow query

More posts by @Cofer257

4 Comments

Sorted by latest first Latest Oldest Best

 

@Angela700

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.

10% popularity Vote Up Vote Down


 

@Nimeshi995

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.

10% popularity Vote Up Vote Down


 

@Connie744

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.

10% popularity Vote Up Vote Down


 

@Connie744

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme