This forum is now read-only. Please use our new forums at discuss.codecademy.com.

HTML Basics Forum

View Course » View Exercise

321 points
053b72686ced3564ecbb512b3c5e1674?s=140&d=retro
Submitted by
bobbysmith
about 4 years ago

Are all 'p' tags necessary?

I tested out the first paragraph without the first 'p' tag in the exercise module and it did the same thing it did when the first 'p' tag was there. Then I did the same thing by removing the 'p' tag from the second paragraph, and this time placed the 'p' tag before and after the first paragraph, and it worked here too.

If there is an explanation, please incorporate that into the lesson itself.


7 votes

permalink

Hi bobby,

Text can either be placed by itself or in paragraphs, but it's generally bad practice to place text by itself.

Later on, when you get onto styling and CSS, you'll be able to change your text's colours, fonts, size, etc. If your text is in a p tag, you know that you can tell CSS to make your desired changes to 'p'.
If your text is just sitting on the page by itself, unless you target the entire body (which will change everything on the page, not just certain elements like p), you have no way of making any changes to that text.

1175 points
5cf83728b241f02f4cc0826b4388591b?s=140&d=retro
Submitted by
Seb
about 4 years ago

1 Comment

053b72686ced3564ecbb512b3c5e1674?s=140&d=retro bobbysmith about 4 years ago

Thanks.


0 votes

permalink

i agree with seb

60 points
07b0d4cd38b9f89694fede349084f626?s=140&d=retro
Submitted by
sarfubna
about 4 years ago


0 votes

permalink

yes

60 points
07b0d4cd38b9f89694fede349084f626?s=140&d=retro
Submitted by
sarfubna
about 4 years ago