Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
This The id attribute worksheet is part of the HTML and CSS Journey journey. Print it as a booklet?
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1<h1 id="main-title">Welcome</h1> | A<section id="about-us">About.</section> | |
| 2<p id="intro">First paragraph.</p> | BGives the h1 element the unique identifier 'main-title' - no other element on the page may use this id | |
| 3id values must be unique - no two elements on the same page may share the same id | CThe paragraph has the unique id 'intro' - it can be selected with #intro in CSS or getElementById in JavaScript | |
| 4id values cannot contain spaces - use hyphens or underscores to separate words | DThe id value 'intro' is used twice - every id must be unique across the entire page | |
| 5<p id="intro">First.</p> <p id="intro">Second.</p> | Eid values must not contain spaces - use id="my-section" or id="my_section" instead | |
| 6<div id="my section">Content.</div> | F<div id="wrapper"> <p id="content">Text.</p> </div> |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
id — An HTML attribute that gives an element a unique identifier on the page. No two elements may share the same id value.<h1 id="main-title">Welcome</h1><section id="about"><p>About us.</p></section><p id="intro">First paragraph.</p><body>
<div id="wrapper">Content here.</div>
</body><footer id="site-footer"><p>Copyright 2024.</p></footer>