Exercise: Using ID attributes

Follow these steps:

  • In the HTML, find the paragraph with the IDAn attribute specifying a unique identifier for an element. paragraph.
  • Load the page, and notice that the ID has no impact on the way the paragraph is displayed.
  • If necessary, resize the window or add extra paragraphs so that the paragraph with the ID paragraph is not visible. You can click on the arrow image in the pane to have the page appear as a separate window. Then click on the hyperlink to see what happens.
  • Add an ID attribute to the first paragraph in the document.
  • Add a hyperlink from the bottom of the document to the first paragraph in the document, using the ID in the first paragraph as the destination anchorA source or destination of a hyperlink..

Note:

Hints:

  • Remember that all IDs must be distinct.

1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
<!DOCTYPE html>
<html lang="en">
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX