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


#1



	</head>
	<body>
	 <h1>
	 <p>11</p>
	 </h1>	
	 
	 <h2>
	 <p>22</p>
	 </h2>
	 
	 <h3>
	 <p>33</p>
	 </h3>
	 
	 <h4>
	 <p>44</p>
	 </h4>
	 
	 <h5>
	 <p>55</p>
	 </h5>
	 
	 <h6>
	 <p>66</p>
	 </h6>
	
	</body>

<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!


#2

@lingfengzyc
Normally you would use

<!DOCTYPE html>
<html>

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

#3

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


#4

OK thank you very much~


#5

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


#6

Hey,
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>

:stuck_out_tongue:


#7

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:

<h1>heading</h1>
<p>paragraph</p>

#8

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