HTML Attributes

tutorial and example
tutorial and example
  • HTML Attributes provide the additional information about HTML elements.
  • Attributes are always specified in the start tag.
  • Attributes usually comes in pairs.

lang Attribute

This attribute helps in declaring the language of the document. Lang Attribute in case of whole document is declared in the html tag.

href Attribute

This attribute is embedded with the anchor tag (<a>) where href specifies the address of the link.

Size Attribute

It defines the size i.e. Height, Width of an image, gif, buttons etc. It can easily understand with the image properties as shown below.

Alt Attribute

It provides an alternate text when an image cannot be displayed. This text is displayed when due to any reason image is not loaded but user can read the alternate text to get the reference information about image.

Style Attributes

It helps in styling of the HTML element. It has the following syntax:


Try Now



Tutorial and Example


Tutorial and Example