Tags in HTML
Types of tags in HTML
Headings
These tags are used for headings in the content of a webpage. These tags are mainly written inside the body tag. There are six heading tags ranging from <h1> to <h6>
Hi, this is a heading
Hi, this is a heading
Hi, this is a heading
Hi, this is a heading
Hi, this is a heading
Hi, this is a heading
Paragraphs and Horizontal lines
These tags are used for paragraph in a webpage. The paragraph tags start with <p> tag and ends with </p>. The <br> is used to break line and helps to enter text in the next line. The <hr> tag is used to enter a horizontal line.
This is a heading
This is first paragraph
This is second paragraph
This is third paragraph
Image tag
These tags are used to insert image in our webpage. The image tag is <img src="source_of_image" >. Here the src should contain the location of the image file. The source of the image file may be local folder location or online link. We have also included an alt (alternative) attribute. In this attribute, you specify descriptive text for users who cannot see the image due to visual impairment or due to image unavailability.
This is a heading
Lists
A lot of the web's content is lists, and HTML has special elements for these. Marking up lists always consist of at least 2 elements. The most common list types are ordered and unordered lists:
- 1. Unordered lists: These are lists where the order of the items doesn't matter. They are represented by <ul> tag.
- 2. Ordered lists: These are lists where the order of the items matters. They are represented by <ol> tag.
This is a heading
- list item 1
- list item 2
- list item 3
Links
Links are very important — they are what makes the web a web! To add a link, we need to use a simple element — <a> — "a" being the short form for "anchor".
This is a heading
Click here to go to home pageThere are a lot of tags in HTML which is out of the scope of this chapter. If you are interested in learning more, you can click here to explore different tags in HTML