Advertisements
Advertisements
प्रश्न
What is the difference between <br> tag and <p> tag in the context of HTML? Illustrate using suitable examples.
संक्षेप में उत्तर
उत्तर
<br> tag:
The <br> tag is used to insert a single line break. The <br> tag can be used to write addresses or poems. The <br> tag is empty, indicating it does not have an end tag.
Example:
<html>
<head>
<title>
Example of BR tag
</title>
</head>
<body>
<p>If you want to break a line <br> in a paragraph, <br> use the BR element in <br> your
HTML document. </p>
</body>
</html>
Output:
If you want to break a line
in a paragraph,
use the br element in Your HTML document.
<p> tag:
The HTML <p> element define a paragraph. A paragraph always begins on a new line, and browsers add some white space (a margin) before and after it. A container tag is the <p> tag.
Example:
<html>
<head>
<title>
Example of BR tag
</title>
</head>
<body>
<p> This paragraph contains a lot of lines in the
source code, but the browser ignores it. </p> <p>
This paragraph contains a lot of spaces in the source
code, but the browser ignores it. </p>
</body>
</html>
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?