Asimple questions need help~~~(from a little freshman :))



<do not remove the three backticks below>

I want to know why we should use<p></p>there
I mean if we just write like this:"<h1>11</h1>"the "11" will also appear, so why we should use<p></p>?

Thank you very very much!


Normally you would use

<!DOCTYPE html>

			Headings & Paragraphs
		<h1>The heading tag of the body</h1>
		<p> paragraph 1</p>
		<p> an other paragraph</p>


nesting paragraph inside headings is a bad idea (and bad practice), the paragraphs should be after headings


OK thank you very much~


thank you ! but could you give me some examples? :heart_eyes:


Just a quick tip:
To make your code visible, instead of d o i n g t h i s ,

<h1>Do this</h1>

and it'll look like this:

<h1>Do this</h1>



sure, you nest them:

<h1><p>nested paragraph, bad practice</p></h1>

But headings and paragraphs are not designed to contain other block level elements, so you should place them after:



This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.