Tags, Elements, Comments and Attributes in HTML

·

1 min read

<Tags>,<>Content</>,<!-- -->,<img src=" "> in html

In HTML, tags are used to define the structure and layout of a webpage. They are the basing building blocks of the website. Tags in html are represented by <> and </>. <> is the opening tag and </> is the closing tag. Some of the tags in html is self-closing tag. In self closing tag their is not any closing tag. Example of self closing tags are <br>,<img>etc.

Elements are the individual components of an HTML document. <>Content</> this is called an Element in HTML.

Comments in html tells used the explanation about the code. For writing comments in the html jus enclose the text in <!-- --> or press ctrl+/(in windows).

Attributes are the additional property the tag. They are added to the opening tag of an element and they always come in the form of name-value pairs. For example, the src attribute is used to specify the source of an image, and the href attribute is used to specify the destination of a link.