Advertisement

Google Ad Slot: content-top

Attributes

~1 min read · HTML
On this page

        HTML attributes provide additional information about HTML elements and are used to modify the behavior or appearance of elements. They are always included in the opening tag and usually come in name/value pairs like this: name="value".


Common HTML Attribute

  • HTML id Attribute
  • HTML class Attribute
  • HTML src Attribute
  • HTML href Attribute
  • HTML title Attribute
  • HTML target Attribute
  • HTML style Attribute
  • HTML alt Attribute
  • HTML width and height Attribute
  • HTML value Attribute
  • HTML disabled Attribute
  • HTML lang attribute

The id Attribute


The id attribute isUniquely identifies an element.

Example

The class Attribute


The class attribute is Defines one or more class names for an element, which can be used by CSS or JavaScript.

Example

Bold Text


The src Attribute


The src attribute is Specifies the source of an image, script, or other external content.

Example
Description of Image

The href Attribute


The href Specifies the URL for a link.

Example

The title Attribute


The title attribute is adds extra information about the element, usually displayed as a tooltip when hovered over.

Example

The target Attribute


The target attribute is specifies where to open a linked document.

Example

The style Attribute


The style attribute is contains CSS styling for an element.

Example

Red Text


The alt Attribute


The alt attribute is provides alternative text for an image if it cannot be displayed.

Example
Description of Image

The width and height Attribute


The width and height attribute is adjust the width and height of an image in pixels.

Example

The value Attribute


The value attribute is specifies the initial value for an input element.

Example

The disable Attribute


The disable attribute is disables an input element, making it unclickable or uneditable.

Example

The lang Attribute


The lang attribute in HTML specifies the language of the element's content. It helps search engines and browsers understand the language used in the document

Example