Skip to Content
Web Design in a Nutshell, 3rd Edition
book

Web Design in a Nutshell, 3rd Edition

by Jennifer Robbins
February 2006
Intermediate to advanced
826 pages
63h 42m
English
O'Reilly Media, Inc.
Content preview from Web Design in a Nutshell, 3rd Edition

id identifier

The id attribute is used to give an element a specific and unique name in the document. In the earlier div example, id was used to label a section of the page as “sidebar.” That means there may be no other element with id="sidebar" in that document (although, it is okay if it appears in other documents on the same site). ID values must be unique.

The HTML 4.01 Recommendation specifies the following uses for id attribute:

  • As a style sheet selector

  • As a target anchor for links (with the same functionality as <a name="">)

  • As a means to access an element from a script

  • As the name of a declared object element

  • For general purpose processing by user agents, essentially treating the element as data

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Responsive Web Design with HTML5 and CSS3

Beginning Responsive Web Design with HTML5 and CSS3

Jonathan Fielding

Publisher Resources

ISBN: 0596009879Errata Page