# HTML - Comments ,Tags v/s Elements and Attributes

Hey, guys let's discuss HTML comments, which are to add notes and explanations to your HTML.

They are used to provide context and documentation for the code and can be useful for commenting out parts of your code that you want to temporarily disable without removing them entirely.

# comments in HTML

you can add your comments to your HTML code by enclosing them within the

<mark>&lt;!--hello web devs--&gt;tag</mark>

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680965042515/10dacd98-0a6a-4740-9bd1-0c1f952e4e70.png align="center")

# **HTML** Tags

In HTML, Tags are used to define the structure and layout of a webpage.They are the building blocks that are used to create elements on a page.

for example: ***<mark>&lt;p&gt;</mark>*** tag is used to create a **<mark>paragraph element</mark>**

***<mark>&lt;h1&gt;</mark>*** tag is used to create a **<mark>heading element</mark>**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680966049895/eaad910c-fbc7-47b9-af60-85088f790a9b.png align="center")

### **output:**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680966092104/d6b5d6ee-a6ea-4802-9b58-b1f0e234ffa1.png align="left")

The Tag may appear in pairs, with an opening tag and a closing like : `<tag>content</tag>`

# **HTML Elements**

Elements are the individual components of an HTML document, such as headings, paragraph and images. Each element is represented by corresponding HTML Tags.

for example: heading element is represented by the ***&lt;h1&gt;,&lt;h2&gt;,&lt;h3&gt;*** etc. tags and for paragraph element ***&lt;p&gt;*** tag

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680967119086/693b7e15-4ea8-42ff-abf8-33f101aeea0a.png align="center")

# **HTML Attributes**

Attributes are used to provide additional about an element. They are added to the opening tag of an element and they always come in the form of name-value pairs.

for example : the ***<mark>src</mark>*** attribute is used to specify the <mark>source</mark> of an image

***<mark>href </mark>*** attribute is used to specify the <mark> destination </mark> of a link

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680967984156/0fa8993c-88ac-47f9-826c-d6a17138ee6c.png align="center")
