HTML Tags

Talk about HTML talk about tags and elements, which will be the main focus of our discussion for the duration of the HTML course.

A web page’s structure and content are defined using HTML tags. HTML tags are enclosed by angle brackets (< >) which are typically found in pairs with an opening tag and a closing tag.

Contents of HTML go in between opening and closing tags.

Examples of HTML tags are <h1>, <p>, <strong> and <a>.

<title>Title of the page is enclosed by title tags</title>
<h1>Website page main heading enclosed by header tags</h1>
<p>The <b>paragraph</b> should be placed in 'p' tags. </p>

Full HTML Document Example:

<!DOCTYPE html>
<html>
	<head>
		<title>Web page Title tag</title>
	</head>
	<body>
		<h1>Page main heading goes in between h1 tags.</h1>
		<p>This is a paragraph in web page. A web page may contain many paragraphs.</p>		
		<h2>This is heading 2 tag</h2>
	        <p>This is another <strong>paragraph</strong>, and here is a hyperlink tag click to visit <a href="https://www.w3scoop.com/">Visit W3Scoop</a>.</p>		
		<p>Make some text <b>bold</b> with opening and closing b tags</p>
	</body>
</html> 

Example Output

Bad Practice:

Pair tags like <div> and <p> must always have closing tags.
It will have an impact on the HTML document page’s structure and make it more challenging to manage, monitor, and identify structure, design, and format issues.

The following list of HTML tags can be categorized into different groups:

Document Structure: These tags are primary tags, which divide the overall document’s structure into main sections. Some of these tags define the type and version, information, declaration, and link to other files, while others define the main contents body section. Examples of such tags are <!DOCTYPE html>, <html>, <body>, and so forth.

Formatting: These types of tags format text and. They specify how the contents are arranged within the document and explain what they might signify to search engines or readers. Tags like <h1>, <p>, and <strong> are examples of such tags.

Lists: These types of tags display and group text in a well-formatted list. These are Unordered lists, Ordered lists, and description lists.

Links: Anchor tag, used to create hyperlinks. Which acts on click to browse into another HTML page. The href attribute specifies the destination URL.

Images: An image tag embeds an image into an HTML page.

Tables: Tables are collections of cells to form columns and rows that contain information such as text, numbers, links, images, and other content.

Forms: Web Forms make pages interactive. HTML forms provide a great way to receive information and data from your website visitors.

Good Practice:

Add both opening and closing tags at the same time before entering contents in between, so that you will not miss any unpaired tags. Some code editor’s auto-complete function can help you with that.