HTML – Attributes

  • HTML attribute is used for additional information
  • Attributes are placed in the start tag
  • Attribute have name and value.
HTML Code

πŸš€ Try it yourself! Click the button below to run the code and see the output in action.

HTML Code

Output

Some Core Attribute

  • id – Unique identifier for an HTML element.
  • title – Specifies a title or tooltip for an HTML element.
  • href – Specifies the URL of the page the link
  • class – Specifies one or more class names for an HTML element.
  • style – Specifies inline CSS styles for an HTML element.
  • lang – Specifies the language of the content inside an HTML
  • height – Used to set the height
  • width – Use to set the width
  • alt – Used to set the alternative text of the image

Leave a Comment