Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Web Design & Development > HTML/XHTML

  • Print
  • + Share This
This chapter is from the book

Labeling Elements in a Web Page

You can use the title attribute to add a tool tip label to practically every part of your Web site. It's particularly helpful for giving your visitors clues about what's needed in form elements, but you can use it to label just about anything.

Figure 3.23 Figure 3.23 You can add a title to any element you wish.

To label elements in a Web page:

In the (X)HTML tag for the item you want to label, add title="label", where label is the text that should appear in the tool tip when a visitor points at the element.

Figure 3.24 Figure 3.24 When your visitors point the labeled element, the title will appear.


  • Explorer for Windows also makes pop-up labels or tool tips out of the alt attribute used in image tags (see page 105). However, if both the title and alt attributes are present in an image tag, the tool tip is set to the contents of the title tag, not the alt tag. So, if you don't want Explorer for Windows to use your alt tag as a tool tip, use an empty title: title="".

  • + Share This
  • 🔖 Save To Your Account