Lesson 5 : HTML Attributes

الدرس 5 : HTML Attributes

Lesson 5 : HTML Attributes

  • All HTML elements can have attributes
  • Attributes provide additional information about elements
  • Attributes are always specified in the start tag
  • Attributes usually come in name/value pairs like: name="value"

Example :

  <! -- The href Attribute --> <a href='https://www.example.com'>Visit example</a> 
  <! -- The src Attribute --> <img src="img_girl.jpg">
  <! -- The width and height Attributes --> <img src='img_girl.jpg' width='500' height='600'> 
  <! -- The alt Attribute --> <img src='img_girl.jpg' alt='Girl with a jacket' > 
  <! -- The style Attribute --> <p style='color:red;'>This is a red paragraph.</p> 
  <! -- The title Attribute --> <p title='I'm a tooltip'>This is a paragraph.</p> 

Important links ِAbout Us

Share with your friends

العودة إلى المقالات