Checked At:04:44
7 Guests
0 Users
Online doing the past 15 Minutes!
brugbart.com - Edition/Last Updated: 13. October 2008
Posted The: 30/07/2008 - AT: 22:02
Edited The: 02/09/2008 - AT: 13:16
This entry is a list of attributes, including a few examples.
Attributes are attached to the opening tag, starting with its name, followed by the equal sign (=) and finally its quoted value.
| Attribute: | Description: |
| style | Used to apply styles. |
| title | Used for tool-tips. |
| class | Used to group elements, and by CSS selectors. |
| id | Unique id_name. |
<p style="font-weight:bold;">A paragraph of text</p>
The style attribute is used to apply CSS styles.
<p><a href="/References/122/" title="Attributes in HTML">HTML Attributes</a></p>
The title attribute will be rendered as a small tooltip in most browsers, use it to apply a subdescription to an element.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>Class attribute Example</title>
<style type="text/css">
.Yellow {
color: blue;
}
.Gray {
color: blue;
}
</style>
</head>
<body>
<h1>Class Attribute Example.</h1>
<p class="Yellow">This paragraph is Yellow.</p>
<p><a href="http://www.brugbart.com/" class="Yellow">Tutorials/References</a></p>
<p><a href="http://validator.w3.org/" class="Gray">The W3C Markup Validation Service</a></p>
</body>
</html>
The class attribute is used to group elements, this makes it easy to style elements by the use of class selectors in css.
The id attribute is similer to the class attribute, elements with an id attribute may be styled by the use of id selectors any given id must not accur more then once in a page, if you need to group elements you should use classes instead, ids are used to apply a unique identifier to an element. Below is a heading with a unique ID
<h1>Example</h1> <p>Section Linking Example</p> <h2 id="Section2">Section2</h2> <p>Second Section</p>
You can link to the second section by adding #Section2 to the url.
The event attributes is used by scripts.
| Attribute: | Value: | Description: |
| onclick | Script | A pointer button was clicked. |
| ondblclick | Script | A pointer button was double clicked |
| onmousedown | Script | A pointer button was pressed down |
| onmouseup | Script | A pointer button was released. |
| onmouseover | Script | A pointer was moved onto. |
| onmousemove | Script | A pointer was moved within. |
| onmouseout | Script | A pointer was moved away. |
| onkeypress | Script | A key was pressed and released. |
| onkeydown | Script | A key was pressed down. |
| onkeyup | Script | A key was released. |
The Internationalization Attributes.
| Attribute: | Value: | Description: | lang | LanguageCode | Language code | dir | ltr|rtl | Direction for text. |
These attributes where listed in the html4.01 Transitional DTD.
Author: BlueBoden
Comments: [0]


Checked At:04:44
7 Guests
0 Users
Online doing the past 15 Minutes!
This page was created in 0.0842089653015 seconds
Welcome Guest