HTML Attributes

[ A Few To Get You Started]

Attribute Description example
alt required for <img> as a text alternative. If the <img> is inside of an <a>, then the alt text should describe where the link goes <img src="dog.png" alt="Deoji" height="200" width="400" />
charset character encoding <meta charset="utf-8" />
class gives an element a classname identifyer <h3 class="special">
colspan defines the number of columns a cell should span. <td colspan="3">
height only use in images to preserve a space; resize externally <img src="dog.png" alt="Man's Best Friend" height="200" width="400" />
href specifies the URL of the page the link goes to <a href="http://www.hitlercats.com" target="_blank" />
id gives an element an id identifyer <p id="intro">
lang declares the language of the web page <html lang="en">
rel specifies the relationship between the current document and the linked document <link href="style.css" rel="stylesheet">
rowspan defines the number of rows a cell should span. <td rowspan = "4">
src the URL of the image you want to display <img src="dog.png" alt="smootchie poochie" height="200" width="400" />
target specifies where to open the linked document <a href="http://www.catswhothinktheyrehiding.com" target="_blank" />
title

specifies extra information about an element.

The information is most often shown as a tooltip text when the mouse moves over the element.

<abbr title="cascading style sheet">CSS<abbr>
width only use in images to preserve a space; otherwise, resize externally with CSS <img src="dog.png" alt="Yo Dawg" height="200" width="400" />