HTML Tags

This lesson discusses HTML tags and their usage in web development.

HTML Tags are used to define the structure and content of a web page. They are enclosed in angle brackets and come in pairs: an opening tag and a closing tag. The opening tag is used to define the beginning of an element, while the closing tag is used to define the end of an element.

When an HTML tag is opened, it must be closed to avoid errors. Some tags are self-closing, meaning they do not require a closing tag. HTML tags can also have attributes, which provide additional information about the element.

<p>Welcome to my website.</p>

The above code shows an example of an HTML tag with an opening tag <p> and a closing tag </p>. The content of the paragraph is "Welcome to my website.".

<img src="https://avatar.iran.liara.run/public" alt="Image" />

The above code shows an example of an HTML tag that is self-closing <img />. This tag is used to insert an image into the document. The src attribute specifies the URL of the image, while the alt attribute provides a text description of the image.