Bookmark and Share

HTML - Attributes

Web page customization begins with HTML attributes. Attributes are like blue print schematics informing the browser how to render an HTML element. As an HTML tag is processed, the web browser looks to these attributes as guides for the construction of web elements. Without any attribute values specified, the browser will render the element using the default setting(s) (usually very boring).

Advertise on Tizag.com

HTML attributes are responsible for customizing web elements. As a web surfer, you've probably seen a vast assortment of color schemes, fonts, and styles -- all of which are brought to you by HTML and CSS element attributes.

HTML - Title Attribute

The title attribute titles an HTML element and adds a tiny text pop-up to any HTML element, offering your web viewers a tool-tip mechanism where information can be found or where a better description of an HTML element can be seen.

Much like the tool tips found in word processing programs, this attribute can add spice to any page while offering the user priceless interactivity. As the mouse hovers over the element, a tool tip is displayed, giving the viewer just one extra piece of information.

HTML Title Attribute:

<h2 title="Hello There!">Titled Heading Tag</h2>

Hover your mouse over the display heading and watch the title attribute in action!

HTML Title Attribute:

Titled Heading Tag

The title attribute is one that has not deprecated and should be used often. Many search engines are capable of identifying this attribute inside your HTML elements, granting increased search rankings based on the relevance of the title attribute text.

HTML - Align Attribute

If you wish to change the horizontal alignment of your elements, you may do so using the align attribute. It allows you to align things left, right, or center. By default, most elements are automatically aligned left, unless otherwise specified.

HTML Align Attribute:

<h2 align="center">Centered Heading</h2>

HTML Align Attribute Display:

Centered Heading

HTML Align Attribute Code:

<h2 align="left">Left-aligned heading</h2>
<h2 align="center">Centered Heading</h2>
<h2 align="right">Right-aligned heading</h2>

HTML Align Attribute Display:

Left-aligned heading

Centered heading

Right-aligned heading

HTML attributes, including align, used to be the primary source for the customization of web elements, but they have now lost their market share to Cascading Style Sheets (CSS). Since most HTML attributes are now deprecated, they should ultimately be avoided in professional-level web design. Nonetheless, having an understanding of HTML attributes will prove to be a tremendous aid for anybody looking to move into professional web development using Cascading Style Sheets.

If you would like to get started now with Cascading Style Sheets, please feel free to move along to our CSS Tutorial.

Bookmark and Share


Tips

  • Use several different attributes to enhance a tag.
  • Completely customize your site through various tag/attribute combos.
  • Use the title attribute to give your user a more interactive experience and to help your SEO rank!


Found Something Wrong in this Lesson?

Report a Bug or Comment on This Lesson - Your input is what keeps Tizag improving with time!

Advertise Here

More Tutorials!
Microsoft Office Tutorials Artist Tutorials