Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

wonder man88
PLUS
wonder man88
Courses Plus Student 961 Points

<p> tag & <d> tag?

Hi, i would like to know the difference between <p> paragraph tag, and <d> division tag?

2 Answers

Steven Parker
Steven Parker
231,047 Points

There isn't any standard <d> tag, you're probably thinking of the <div> tag.

Here are some excerpts from the MDN pages on both:

For the paragraph::

The HTML <p> element represents a paragraph. Paragraphs are usually represented in visual media as blocks of text separated from adjacent blocks by blank lines and/or first-line indentation.

Paragraphs are block-level elements, and notably will automatically close if another block-level element is parsed before the closing </p> tag.

And for the division:

The HTML Content Division element (<div>) is the generic container for flow content. it's used to group content so it can be easily styled using CSS. Both the starting and ending tag are mandatory.

The <div> element does not inherently represent anything, and should be used only when no other semantic element (such as <article> or <nav>) is appropriate.