HTML Language Learn: What is Attributes in HTML

what is attributes in HTML?

An HTML attribute is an attribute that is written in the opening tag of an HTML element, and this attribute can affect the element or its content in a complete or relative way.

Before starting this lesson called: HTML Attributes, we would like to welcome our dear visitors. Welcome and thank you for following us.

Before delving into the explanation, you should know that HTML attributes are divided into two types.

  • global attribute
  • element attribute

Global attribute in HTML:

global attribute You can use it in all HTML elements.

element attribute in HTML:

The attribute element cannot be used in all HTML elements, as it is an attribute for one element and not all elements.

How to write attribute in HTML?

The HTML attribute is written in the opening tag of the element immediately after the element name. The HTML attribute consists of a name and a value.
For example:
<tag attribute name = “attribute value”>Item content</tag>

note:

You can write the value of the attribute without putting it between two signs “” or ”, but if the value consists of two words, it is better to put it between one of the two signs.

You can also put the attribute value under the attribute name
For example:
<tag
attribute name
=
“attribute value “>
Item content
</tag>

Thank you for reading the article and do not forget to share it with friends

Post Comment

You May Have Missed