Difference between revisions of "Attribute (HTML)"
From Wiki @ Karl Jones dot com
Karl Jones (Talk | contribs) (→Examples) |
Karl Jones (Talk | contribs) (→Examples) |
||
Line 17: | Line 17: | ||
<nowiki><a href="http://wikipedia.org">Wikipedia</a></nowiki> | <nowiki><a href="http://wikipedia.org">Wikipedia</a></nowiki> | ||
− | In | + | In the example below, the value of the attribute is another [[web page]] on the same [[website]]. |
<a href="../another-page.html">Another web page</a> | <a href="../another-page.html">Another web page</a> |
Latest revision as of 18:48, 20 April 2016
In HTML, an attribute is part of an HTML element.
See also Attribute–value pair.
Examples
The a element requires an attribute named href, which specifies what the link is linking to.
The attribute looks like this:
href="value"
Where "value" is a URL, or a path to a resource.
In this example, the value of the attribute is a fully-qualified URL for Wikipedia:
<a href="http://wikipedia.org">Wikipedia</a>
In the example below, the value of the attribute is another web page on the same website.
<a href="../another-page.html">Another web page</a>