The id
attribute assigns a unique name to an element. Similar to the name
attribute of the <a>
element, but it allows any element in the document body to be the destination of a link.
footnotes
:Style sheet rules can be assigned to specific id
values (unlike the obsolete name
attribute).
If your Web browser supports style sheets, the following should produce a centered and italicized paragraph.
poem
identifier:Higgledy‐piggledy
Nic’laus Copernicus
Looked at the Universe
Spoke to the throng
Give up your Ptolemy
Rise up and follow me,
Heliocentrically
Ptolemy’s wrong
The class
attribute assigns class names to an element. Classes are used as style sheet selectors.
If your Web browser supports style sheets, the following should produce a paragraph with an underlined, blue phrase.
fake
and link
classes:<span>
with two classes, fake
and link
:Your Web browser identified itself as Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
when it requested this page. Mozilla 5.0
, why do you lie to me so?