paragraph tag

Previous
Next

Paragraphs:

  • We can directly specify the text with body tag.
  • Without tags, if we write any text data is called unformatted text.
  • It shows on the webpage as we mentioned.
<html>  
	<head>  
		<title>Conversation </title>  
	</head>  
  
	<body>  
		Syam: Hi, this is Syam.
		Sidhu: Hi, I'm Sidhu. .
		Syam: What is your website name?
		Sidhu: www.tutipy.com 
		Syam: Wow, I will check out myself
		Sidhu: Thank you
	</body>  
</html>
  • When we run the above document, it will not display the information how we formatted.
  • HTML collapses whitespace, which means that all our text will collapse into a single paragraph.

Note: Here we can use paragraph tag <p> to arrange the conversation instructions in a proper way.

<html>  
	<head>  
		<title>Conversation </title>  
	</head>  
  
	<body>  
		<p>Syam: Hi, this is Syam.</p>
		<p>Sidhu: Hi, I'm Sidhu. .</p>
		<p>Syam: What is your website name?</p>
		<p>Sidhu: www.tutipy.com </p>
		<p>Syam: Wow, I will check out myself</p>
		<p>Sidhu: Thank you</p>
	</body>  
</html>
  • Most of the people will think that instead of using <p> tag, it is better to use <br/> to send the control to new line.
  • <p> tag is the non-empty element, we need to use start tag & end tag.
  • <br> tag is empty element.
  • but <br/> tag send the control to immediate line to display the next instruction information where as <p> tag provides a line gap.
<html>  
	<head>  
		<title>Conversation </title>  
	</head>  
  
	<body>  
		<p>Syam: Hi, this is Syam.<br/>
		<p>Sidhu: Hi, I'm Sidhu. .<br/>
		<p>Syam: What is your website name?<br/>
		<p>Sidhu: www.tutipy.com <br/>
		<p>Syam: Wow, I will check out myself<br/>
		<p>Sidhu: Thank you<br/>
	</body>  
</html>
Previous
Next

Courses Enquiry Form