Tip About The Paragraph Element in HTML

When using the paragraph element in your HTML markup, think about the semantic definition of the paragraph element. A paragraph is a block of text; therefore, you should use it as a block of text. 

Don’t nest other block level elements inside a <p> element.  For instance, it does not make sense to nest a paragraph inside of a paragraph. When the second paragraph begins, it means that the first paragraph has ended. If you nest other block level elements inside of a <p> element, the web page might not display as you imagined.  Furthermore, your markup becomes semantically illogical which might make it more difficult for yourself or others to maintain.

Advertisement

Tags: , , , , ,

2 Responses to “Tip About The Paragraph Element in HTML”

  1. mjfox Says:

    it all makes so much sense now

  2. kourtesy Says:

    Good, I’m glad that I could help

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.