Attributes and Hyperlinking
Get an understanding of HTML attributes and how they can be linked to other HTML pages.
HTML attributes
HTML attributes provide additional information about an HTML element. Attributes can be considered as properties of the element. An element may have a single attribute, many attributes, or no attributes at all.
Let’s take a look at an example heading with a title
attribute:
<h2 title="This is a subheading">Hello, World!</h2>
Attributes are placed in the opening tag, with a space after the element declaration (or another attribute, if there are multiple) and are defined using the following format:
<tagName attribute_name="attribute_value"></tagName>
The attribute name is always followed by an =
sign and the attribute value is always wrapped in quotation marks. There are no spaces between the attribute name, =
sign, and the attribute value.
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy