Attributes
The attributes in a tag are used to provide extra information about the element.
For example
This is a heading
Hover over the heading below to produce the pop-up effect:
This is a heading
The most popular Attributes
Here are some of the most popular attributes you will come across a beginner in coding.
- alt - provides the description text of an image
- src - provides the source of an element, usually an image
- width - sets the width of an element, usually an image
- height - sets the height of an element, usually an image
- href - provides the URL for a link
- style - sets the styling parameters of an element
- target - defines how a page will open (e.g same tab or a new one)
- lang - defines the language of the web page
- wrap - defines if the text will get wrapped
- id - sets an id for a unique element
- class - sets a class for an element or a range of elements
- name - sets the name of the element
- title - provides extra information about the element
Note: the attributes are always inserted in the opening tag and follow the name/value format e.g width="250"