HTML tags have attributes. Attributes allow you to change different properties of the tag. They always go inside the start tag. For example:
<h1 style=”color: red”; > Hello World </h1>
The attribute in the above example is called style. We are putting the style attribute inside a <h1> tag. The style attribute allows you to change the way a tag is styled. In this case, we are styling the <h1> tag to have the color red. There are many attributes that you can use in different tags. Attributes always have follow the formula: attribute name = “value“
For example: (attribute name = width , value = 20px) leads to: width=”20px”
Table of possible attributes you can use:
src | specifies an image filename . |
width | changes width of image. |
height | changes height of image. |
style | used to change styling elements. |
lang | used to declare what language the document is in |
title | can be applied to <p> tags, appears when hovering over paragraph. |
href | defines the link address in <a> tags. |