Quantcast
Channel: Web Standards » tutorial
Viewing all articles
Browse latest Browse all 2

HTML 1001: Break Out of The WYSIWYG Editor Part II

$
0
0

In Part I I covered the essentials of HTML with an emphasis on providing structure for your content. Now I want to dig just a bit deeper.

There are also some optional attributes that are common to all HTML tags. The first is the ”id” attribute:

<img src=”path/to/image.jpg” alt=”Description of the image.” id=”example” />

All id’s on a page should be unique. You can reference the id in your CSS for this image if you need to apply special style rules to this one image. Also, JavaScript can select this specific image by referencing the id.

The next common optional attribute is ”class”:

<img src=”path/to/image.jpg” alt=”Description of the image.” id=”example” class=”slide” />

Classes are not unique. They can be useful if you want to apply style rules to several elements on a page at once. They’re also useful if your JavaScript needs to reference several elements. Tags can have more than one class separated by a space:

<img src=”path/to/image.jpg” alt=”Description of the image.” id=”example” class=”animated slide” />

In the words of Amanda C, ”You’re the only one with your student ID number, but there are a bunch of other students in your class.” We’ll revisit id’s and classes in future posts about CSS and JavaScript.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images