HTML Basic Tags

Heading Tags: This tag represents the document header. It is said to be a good practice if every document starts with Heading. Heading tags ranges from H1 to H6 i.e. six different levels where H1 is max size and H6 is the min size. 

  Example:
<!DOCTYPE html>  
<html>  
<head>  
<title>Heading Example</title>  
</head>     
<body>  
<h1>Tutorial and Example</h1>  
<h2>Tutorial and Example</h2>  
<h3>Tutorial and Example</h3>  
<h4>Tutorial and Example</h4>  
<h5>Tutorial and Example</h5>  
<h6>Tutorial and Example</h6>  
</body>     
</html>
Paragraph Tag: This<p> tag let your Html document text to structure into different paragraphs. This tag is a non-empty tag thus, <p> is for opening and </p> for closing tag. 

Example:
<!DOCTYPE html>
<html>
<head>
<title>Paragraph Example</title>
</head>
<body>
<p>This is Tutorial and Example Website </p>
<p>You are reading HTML tutorial</p></body>
</html>

  Output:
This is Tutorial and Example Website
You are reading HTML tutorial
Line Break Tag: This tag is an empty tag which allows programmer to break the line immediately after its placement. Anything that follows it starts from the new line. Example:
<!DOCTYPE html>
<html>
<head>
<title>Line Break Example</title>  
</head>
<body>
<p>You are reading Tutorial on
<br>TutorialandExample.com Website <br> Thanks. </p>
</body>
</html>


  Output:
You are reading Tutorial on
TutorialandExample.com Website
Thanks.
Center Tag: This tag is used to put any content on the center of the page or any table cell. Example:
<!DOCTYPE html> 
<html>  
<head>  
<title>Center tag Example</title> 
</head>     
<body>  
<p>TutorialandExample.com </p>  
<center><p>TutorialandExample.com </p><center>  
</body>  
</html>


  Output:
TutorialandExample.com
TutorialandExample.com
PRESERVE FORMATTING: As the name suggest it allows your text to follow exact format of how it is written i.e. it preserve your text on which format it is written. 
Syntax is <pre>....</pre>.
Example:
<!DOCTYPE html>  
<html>  
<head>  
<title>Preserve Formatting Example</title>  
</head>     
<body>  
<pre>TutorialandExample.com is a website which provide tutorials   
{In many technology}. Also the fastest (Growing website) having alert   
(very high trust percentage) </pre>  
</body>  
</html>
Output:
TutorialandExample.com is a website which provide tutorials   
{In many technology}. Also the fastest (Growing website) having alert   
(very high trust percentage)
Non-breaking Spaces: It is used when we don't want browser to split the text across two lines. Its syntax is &nbsp. Example:
<!DOCTYPE html> 
<html>  
<head>  
<title>Non-breaking Space Example</title>  
</head>     
<body>  
<p> Basic example is TutorialAndExample</p>  
</body>  
</html>
Output:
Basic example is Tutorial And Example



ADVERTISEMENT
ADVERTISEMENT