Basic HTML Tags

As we have earlier discuss that what will be the basic format of html document. Now we will see some basic html tags which we can use within body to make our webpage look more attractive and organized.

HTML Tags:

HTML tags are similar to keywords, they specify how a web browser can format and view content. The opening tag, the content tag, and the closing tag are the three key parts of an HTML tag.

In this section we will discuss basic html tags, below:

1.Heading Tag:

For defining heading level html heading tag is use which have different levels from <h1> to <h6>.Different headings of various sizes are supported by browser such that <h1>being the largest and <h6> being the smallest heading level.

Note: When any heading is shown the browser appends one line before and one line after the heading.

Example

<!DOCTYPE html>
<html>
<body>

<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>

</body>
</html>

Visit https://www.tutorialsart.com/html-heading/ to learn html heading in detail.

2.Paragraph Tag

Now we will discuss paragraph tag whenever we have to split our content in different paragraphs we will use paragraph tag. This tag will start from <p> and before starting next paragraph we must have to close the first opened paragraph by using this </p>.This tag will be used within body tag.

Example

<!DOCTYPE html>
<html>
<body>

<p>First paragraph</p>
<p>Second paragraph</p>

</body>
</html>
HTML Tags

3.Center Tag

If you want to align your text in center of page, table or form you can use this tag. It starts with <center> and end with </center> .

Example

<!DOCTYPE html>
<html>
<body>
<center>
<p>The text written in this tag will appear in center</p>
</center>
<p>Second paragraph</p>

</body>
</html>

4.Horizontal Line Tag

To visually breakup the parts of text <hr> is use, this tag break the content into parts and generate a horizontal line between these parts. Basically we use this tag to separate content in html page. This tag is example of empty element.

Example

<!DOCTYPE html>
<html>
<body>

<p>First paragraph</p>
<hr>
<p>Second paragraph</p>

</body>
</html>

5.Line Break Tag

The <br>tag is used when we have to move the content on next line, So, the text following this tag will start from next line. This tag is also an example of empty element so we do not closing tag for it.

Example

<!DOCTYPE html>
<html>
<body>

<p>Hello<br>Welcome to tutorials art</p>

</body>
</html>

Comments are closed.