Home
 › Learn
 › HTML

HTML: List of Common Attributes

Learn about Common HTML Attributes. There are a bunch of html attributes but not all are used frequently, we will look on common elements.

Updated At: November 2024
HTML: List of Common Attributes

Attributes Table

Attributes

Description

Example

href

The href attribute specifies the URL of the page the link goes to:

<a href="">Something</a>

src

The src attribute specifies the path to the image

Absolute URL
⁠Relative URL

⁠Relative URL
⁠<img src="/logo.png">

⁠Absolute URL
⁠<img src="https://www.somewebsite.dev/logo.png">

alt

Alternate text, if image is not loaded

<img src="/logo.png" alt="logo">

width

specify the width

width=100px

height

specify the height

height=100px

style

The style attribute is used to add styles to an element, such as color, font, size, and more.

style="width:100px"

⁠⁠

We will do a small hand-on exercise on Elements and Attributes in next article.

⁠⁠References:

JavaScript

    React

      NextJS

        HTML

          CSS

            Sign up for our newsletter.

            Copyright © theHardCoder 2023 - 2025