×

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

Related Topics

HTML Background Image

Inserting image in HTML An image (technically digital image) in HTML or even in general technical aspects, is a binary representation of visual information. By visual information we mean, in the...

8 minutes read.

HTML Font Color

The HTML <font> tag has an attribute called color, which defines the color of the text. We use the color attribute inside the <font> tag to specify the color of...

6 minutes read.

HTML Reset Button

The HTML reset button is used to reset all values in the form. It clears all input fields. Reset is the value of the type attribute of the button element. The...

6 minutes read.

HTML <strike> tag

The HTML <strike> tag is used to specifies strikethrough text. The tag is deprecated now and <del> tag is used in HTML files instead of it. All the global and...

2 minutes read.

HTML Unordered List

In HTML, we have <ul> tag which defines the unordered list. And it is also known as bulleted list, because as we know it is not ordered list therefore it...

2 minutes read.

HTML Forms

Forms are required when we want to collect data from the user. Html forms consists of different fields to take user inputs such as: input, text area, checkbox, password, radio...

4 minutes read.

CSS Clearfix

CSS Clearfix: A clearfix (or clear float) in CSS is for a component to clear or fix the child component, so we don’t need to insert additional markup. The clear...

4 minutes read.

HTML <table> tag

The Table element If we want to show the data and information in a two-dimensional table with rows and columns, then we can achieve this by using the HTML element <table>. Syntax: <body> <table> <thead> <tr> <thcolspan="#">………….</th> </tr> </thead> <tbody> <tr> <td>……….</td> <td>……….</td> </tr> </tbody> </table> </body> Example: <!DOCTYPE...

9 minutes read.

HTML Text Format

Introduction HTML may format text in two different ways. The HTML tags define a text property to make it appear one way or another. A text element may also be formatted...

7 minutes read.

HTML5 Formatting

HTML Formatting HTML Formatting is a method of text formatting for a better appearance and look. HTML allows us to format text without using the CSS. HTML includes a lot of formatting tags....

6 minutes read.

HTML Data Tag

HTML Data Tag: The HTML < data > tag is used to transmit its content to a machine-readable version. The data are presented in a particular format. It is useful...

3 minutes read.

HTML <sup> Tag

The HTML sup element is used to describe one or more superscript contents. The sup tag shows a text which is presented above the regular line and half the length...

2 minutes read.

Div Tag in HTML

In HTML, ‘div’ is a tag that specifies division or section in HTML document. But before going in detail of it, let’s first understand about tags in HTML. The tag...

8 minutes read.

HTML Anchor

HTML Anchor The HTML anchor tags define a hyperlink that links to other pages on one page. It can create hyperlinks to any web page and files, locations or any other...

3 minutes read.

Font tag in HTML

HTML stands for Hypertext Mark-up Language and is used to create web pages and other information that can be later displayed in a web browser. It also consists of a...

4 minutes read.

HTML <video> Tag

The Video tag in HTML is used to play video on a media player on the web page. We can also insert an audio by the video tag, but audio...

6 minutes read.

HTML Form Action

The <form> tag has an attribute named action that contains a URL. The HTML action attribute defines the webpage URL on which you want to send the data after submitting...

4 minutes read.

HTML <style> tag

The section of information that we want to style is contained in html style tag. It includes CSS, which is used to design the text and images in the web page. Syntax: <head> <title>…………....

3 minutes read.

What does HTML stand for?

HTML stands for Hyper Text Markup Language. We use this markup language to design a web page. Web browsers use this language to showcase text, videos, images, audio and other...

6 minutes read.

HTML Audio

HTML AUDIO: HTML5 provides a method to embed the audio file into a webpage by using HTML5. Before HTML5 audio files is used to play on the browser with the help of...

1 minute read.