Join Digital Nomads and Remote Workers to Ask Questions, Share Experiences, Find Remote Jobs and Seek Recommendations.

HTML Attributes


When writing HTML code, we create HTML element with HTML tags with <p>, <h1>, <h2>, <a> and many more. If you want to control the HTML element, we use HTML attributes to provide additional information. At here, we will show you how to add the HTML attributes name and value to the element. To add the attributes, we must add it at the opening HTML tag.

Html Element Structure

From the image above, you can see the HTML attribute is located in opening HTML tag. You can’t place it at closing HTML tag or anywhere else.

The href Attribute

Let me show you one example over here. When creating the hyperlink for HTML document, we use <a> element. The <a> itself won’t provide the redirection of the web page. At here, we need to add the href attribute and make the hyperlink redirect to my website.

<a href="">Welcome to</a>

As you can see, the HTML attributes are use for adding additional information to the HTML element to do whatever user want to the element.

Useful Attributes

There are also some important attributes that you must know about them because you might use it almost all the time.

  • id
  • class
  • style

The attributes related to CSS. It’s a style sheet for HTML, I don’t want to confuse you with this tutorial. So, it’s recommend u click on the link on the text for more information.

We Work From Anywhere

Find Remote Jobs, Ask Questions, Connect With Digital Nomads, and Live Your Best Location-Independent Life.