Tags in HTML
HTML Tags
HTML tags are element names surrounded by <> brackets:
tag start like <tagname>content hereā¦.. tag close</tagname>
HTML tags come in pairs like <h1> and </h1>
The first tag is the start tag, the second tag is the end tag
The end tag is written like the start tag, but with a forward slash inserted before the tag name
The start tag is also called the opening tag, and the end tag the closing tag.
HTML Basic Tags
Paragraph Tag
In HTML <p> tag is used for paragraph your text. Each paragraph of text insert between <p> and a closing </p> tag
Example
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
</head>
<body>
<p>first paragraph of text.</p>
<p>second paragraph of text.</p>
</body>
</html>
Heading Tag
All document in web pages starts with a heading. We use in html six heading tag,which is <h1>, <h2>, <h3>, <h4>, <h5>, and <h6>. While displaying any heading, browser adds one line before and one line after that heading.
Example
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
</head>
<body>
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>
</body>
</html>
Break Tag
<br> tag is used to start new line in HTML <br> tag has no need to close.
The <br /> tag has a space between the characters br and the forward slash.
Example
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
</head>
<body>
<p>Line break example<br />
Line One.<br />
Line Two <br />
Line 3</p>
</body>
</html>