Assigning an ID to an element

Any element in a document can be assigned a unique ID. Although element IDs can be used in a variety of ways, the two most common uses are:

How you assign an ID to an element depends on what the element is.

If the element is a…

Assign it a unique ID by doing this:

  • paragraph
  • heading
  • list item
  • preformatted block
  • address
  • term
  • definition
  1. Place the insertion point inside the element.
  2. On the Home menu, go to Style, and then click Class/ID.
  3. In the ID box, type a unique ID.
  • any other kind of element
  1. Select the element. (If the element cannot be directly selected in the document window, use the Tag SelectorThe Tag Selector appears on the left side of the status bar when the pointer is over the canvas in Edit mode. To select an element, click the corresponding tag in the Tag Selector. to select it.)
  2. On the Home menu, go to Style, and then click Class/ID.
  3. In the ID box, type a unique ID.

Namo Web Editor icon note Assigning an ID to an elementAn ID must begin with a letter and may contain letters, numbers, hyphens, underscores, colons, and periods.

Related topics

Defining a style

Assigning an ID to an element