The paragraph tag is used to define a paragraph on a web page. Empty line is added before and after the paragraph tag by the browsers.
< p >Content to be displayed< /p >
All the extra spaces and lines are removed by the browsers and the content is displayed.
Hr tag is used to draw a horizontal line between 2 lines or 2 paragraphs. It is an empty element that means it doesn’t require a closing tag.
A paragraph is defined by the HTML <p> tag. Both closing and opening tags are present for it. As a result, anything between <p> and </p> is considered as a paragraph. Even if we don't use the closing tag, </p>, most browsers perceive a line as a paragraph, which can lead to unexpected consequences. As a result, it is both a good convention and a requirement that we utilise the closing tag.
When we examine the webpage, we notice that a few spaces have been inserted before and after each paragraph. HTML does this by default. Here are a few key properties of the paragraph tag:
All the extra spaces and lines are removed by the browsers and the content is displayed.
Hr tag is used to draw a horizontal line between 2 lines or 2 paragraphs. It is an empty element that means it doesn’t require a closing tag.
Knowledge2life is best learning website.
Knowledge2life is best learning website.
Knowledge2life
Knowledge2life is best learning website.
Knowledge2life
Knowledge2life is best learning website.
|