Hello. Such a question, is it allowed to enclose h1 in a div?

<div class="block"><h1>Заголовок</h1></div> 

Will this not adversely affect the SEO site? and in general, does it matter?

  • in terms of html validity, then yes, you can. From the point of view of the CEO, it does not matter. Perhaps at some point you can get immediate benefits (for example, because the search parser broke), but in general - no. - KoVadim

2 answers 2

Generally allowed.
But if you just wrap one block element in another, then it’s just pointless :)

In your case, it's better to use the <h1 class="block">Заголовок</h1>

Does not affect the seo, the main thing to remember is that there should be one h1 header on the page

  • If I need 4 pseudo-elements, then there is a sense: D - Qwertiy

Of course allowed. I do not know a single element H1, which is not a child of the div - article - main. This element is one of the basic elements for building the DOM document object model . Search engines use headings to index the structure and content of your web pages. Info W3 about it + more info W3 . But I also agree with the answer of Nikolay, that in the code example you specified it is nonsense.