HTML Attributes

1/29/2020 12:00:00 AM

We know HTML tag or element this tag is contain an attribute. Attributes nothing but a key word which is Name/value paired. Like “Name=”value””. Every html tag has deferent attributes. This attribute provides the additional information of the html tag or element. Html attribute must and should write the html start tags. In the HTML we have deferent type of attributes now given bellow the name of the attributes:

  • href Attribute
  • class Attribute
  • id Attribute
  • title Attribute
  • src Attribute
  • width and height Attributes
  • alt Attribute
  • style Attribute
  • lang Attribute

Now given bellow the attribute example code and explain the attribute code:

<!DOCTYPE html>
      	<title>This is HTML</title>
      <!--HTML Attributes-->
  <!--href Attribute-->
  <a href="">Go to</a>
  <!--class Attribute-->
  <div class="ClassName"></div>
  <!--id Attribute-->
  <div id="myId"></div>
  <!--title Attribute-->
  <p title="Farhan Sakib Jesy">
  <!--src Attribute-->
  <img src="jesy.jpg">
  <!--width and height Attributes-->
  <img src="reza.jpg" width="800" height="500">
  <!--alt Attribute-->
  <img src="reza.jpg" alt="invelid image">
  <!--style Attribute-->
  <p style="color:red">Reza karim.</p>
  <!-- lang Attribute-->
  <html lang="en-US">

In this code we see the all attribute in html element. This element is responsible to deferent type play the role like ‘href’ attribute is responsible to hyper link to another link.