Broad Network


HTML5 Commonly Used Global Attributes

Mastering HTML5 - Part 7

Forward: In this part of the series we look at HTML 5 Commonly used Global Attributes.

By: Chrysanthus Date Published: 22 Jul 2012

Introduction

This is part 7 of my series, Mastering HTML5. I assume you have read the previous parts of the series before reaching here. In this part of the series we look at HTML 5 Commonly used Global Attributes.

Note: If you cannot see the code or if you think anything is missing (broken link, image absent. Etc.), just contact me at forchatrans@yahoo.com. That is, contact me for the slightest problem you have about what you are reading.

A Global Attribute
A global attribute is an attribute that can be used by all HTML elements.

The id Attribute
The id attribute identifies the element. The value of the id attribute must be unique for the whole document. An example of the use of the id attribute can be seen in,

    <p id="F5">
        text text text …
    </p>

The id attribute can be used with any HTML element. The value of the id attribute should not have any space.

The title Attribute
We saw the title attribute in the tutorial in this series, whose title is, HTML 5 Tooltip. The title is a tooltip. If the title attribute is present, when the user’s mouse pointer goes over the element, he sees the tooltip. An example of the use of the title attribute can be seen in,

    <a href= "url" title= "Explanation of topic">Topic</a>

Do not confuse between the title element and the alt attribute. The title attribute is a tooltip that can be used with any HTML element. The alt attribute is a tooltip only for the image element.

The style Attribute
The style attribute is used to give any HTML element a special presentation. The word, presentation here, means, color of element, font in element, size of element, position of element, etc. Understanding the values for the style attribute needs a whole course. You can have that course in my blog; it is CSS3. An example of the use of the style attribute is in,

    <p style="color:green">
        text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text
    </p>

In this example, all the text in the paragraph will be green.

We can stop here. You can learn the other global attributes either in my advanced tutorial series or in other courses.

We continue in the next part of the series.

Chrys

Related Links

Major in Website Design
Web Development Course
HTML Course
CSS Course
ECMAScript Course
NEXT

Comments

Become the Writer's Fan
Send the Writer a Message