Хотя <p>
может жить после <h1>
, для DOM все еще неправильно и плохо создавать заголовок внутри <p>
.
<html>
<body>
<!-- Unconventional: The <h1> has a larger scope than <p> and should not
live inside of it. -->
<p><h1>Hello? Yes this is answer.</h1></p>
<!-- Conventional: The <h1> is larger in scope than <p> and the <p> is
inside of the <h1>. -->
<h1><p>Hello? Yes this is answer.</h1></p>
</body>
</html>
Точно так же, <p>
и <h1>
могут появляться в любом порядке, если они следуют хорошим правилам определения области действия.