Wednesday, May 9, 2018

Web Programming Lessons - HTML - Attributes

HTML Attributes

HTML 5 attributes are written inside the element's tag and separated by spaces. all of HTML elements can have Attributes.

we can provide additional information about an element using HTML attributes.Attributes are always specified in the start tag.

Attributes give extra information about an element for example in the input element the attribute type gives the type of input, so if he had type="button" we would get a button instead of a text-box. Attributes are very important to HTML and without them Web development would be probably much harder.

EX : -            
  •                      <input type="text" value="hello Web"/>
  •                      <a href="https://www.google.com">This is a link</a>

The Id Attribute
The Id attribute is a unique Identifier for the element.The Id property becomes very useful when using CSS and JavaScript.An example of the Id Attribute.
<form id="htm_form">
</form>
The name Attribute
The name Attribute specifies a name for an element.Conventionally groups if elements can have the same name.
The class attribute
This specifies the style class under which an element falls. NB:An Attribute can also be called a property



No comments:

Post a Comment