We can change the way many tags behaved using attributes.
For example, we can create a hyperlink using the a (anchor) tag like so:
<a> A Hyperlink </a>
This is nice, but our hyperlink doesn’t currently point at anything. If you click it you will go nowhere. We can fix this using an href (hypertext reference) attribute:
<a href="http://www.google.com"> A Working Hyperlink </a>
You can have as many attributes as you like separated by a space:
<a href="http://www.google.com" title="Search on Google">
A Working Hyperlink
</a>
There are a great many attributes, some of which affect the behaviour of a tag, and some of which affect it’s appearance. Generally speaking you should not use attributes to change the appearance of an element.
You’ll find some tutorials online suggesting attributes such as:
Never use these. We’ll see why, and we’ll see the correct solution to styling later when we get to CSS.
%aside