← Web development final test lesson New set →

Web Development Worksheet: Final Test

HTML and CSS lesson 30: Web development final test · Set 802 · 40 questions
TalentJR

Code tip (Read it like a browser): Find the topic: HTML, CSS, JavaScript or how the web works. Read the code line by line, the way a browser would. For sums and loops, write each step down and check it again.

NameDateTime takenScore ___ / 40
  1. 1.True or false: h1 is an element selector. (a) True (b) False
  2. 2.📝 At most, how many of these can be chosen at the same time?
    <form>
      <input type="checkbox" name="colour"> Blue
      <input type="checkbox" name="colour"> Green
      <input type="checkbox" name="colour"> Red
    </form>
  3. 3.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 90px;
      padding: 15px;
      border: 4px solid black;
      margin: 10px;
    }
  4. 4.🔗 Which code links to about.html? (a) <a href="about.html"> (b) <a alt="about.html"> (c) <link about.html> (d) <a src="about.html">
  5. 5.Which of these does HTML do? (a) makes headings and lists (b) adds space around boxes (c) counts down a timer (d) lays out the page
  6. 6.⚡ Which tag holds JavaScript in a page? (a) <js> (b) <code> (c) <style> (d) <script>
  7. 7.🎯 How many elements on a page should have the same id? (a) any number (b) 2 (c) 5 (d) 1
  8. 8.🔒 Is the connection to this address scrambled (encrypted)?
    https://www.example.net/news/today.html
    (a) No (b) Yes
  9. 9.Which of these is an opening tag? (a) <p> (b) </li> (c) </p> (d) </b>
  10. 10.⚖️ Two rules with the same selector set a colour. Which one wins? (a) neither (b) the first one (c) the later one (d) the shorter one
  11. 11.🚀 Which file should this code go in: alert("Hi"); (a) style.css (b) script.js (c) index.html
  12. 12.🌈 In #rrggbb, which colour do the last two digits give? (a) green (b) white (c) blue (d) red
  13. 13.🏷️ What does a closing tag have that an opening tag does not? (a) a dot . (b) a slash / (c) a hash # (d) a dollar $
  14. 14.📊 How many rows does this table have?
    <table>
      <tr><td>Litchi</td><td>Mango</td><td>Jamun</td><td>Banana</td></tr>
      <tr><td>Jamun</td><td>Litchi</td><td>Papaya</td><td>Orange</td></tr>
      <tr><td>Banana</td><td>Grapes</td><td>Litchi</td><td>Papaya</td></tr>
    </table>
  15. 15.🔠 How many headings are in this code?
    <h1>My pets</h1>
    <p>Hello, world!</p>
    <h4>Hello, world!</h4>
    <h3>Rain today</h3>
    <h3>Our school trip</h3>
  16. 16.🔠 Which heading shows the BIGGEST text: <h1>, <h4>, <h3> or <h6>? (a) <h1> (b) <h6> (c) <h4> (d) <h3>
  17. 17.True or false: “skipping heading levels” helps everyone use the page. (a) True (b) False
  18. 18.📊 Which tag makes a heading cell? (a) <caption> (b) <td> (c) <th> (d) <table>
  19. 19.True or false: padding is the line round the box. (a) False (b) True
  20. 20.📝 Which input type is for one line of words? (a) submit (b) password (c) checkbox (d) text
  21. 21.♿ A part of the page is under a <h5> heading. Which tag should its sub-heading use? (a) <h2> (b) <h6> (c) <h5> (d) <h3>
  22. 22.🧩 Which language reacts to a button click? (a) JavaScript (b) HTML (c) CSS
  23. 23.🖼️ How many pixels wide is the picture drawn?
    <img src="map.png" alt="Map of India" width="150">
  24. 24.💬 Which text will NOT show on the page?
    <!-- <p>My pets</p> -->
    <p>Our school trip</p>
    <p>The red kite</p>
    (a) Our school trip (b) My pets (c) The red kite
  25. 25.⚖️ Which selector is the weakest? (a) a class selector (b) an id selector (c) an element selector
  26. 26.True or false: <b> is an empty tag. (a) False (b) True
  27. 27.✍️ How many declarations (property: value pairs) are in this rule?
    h2 {
      font-size: 20px;
      font-weight: bold;
      margin: 10px;
      width: 300px;
    }
  28. 28.💪 How much empty space (px) is before the first box?
    .row {
      display: flex;
      width: 200px;
      justify-content: flex-end;
    }
    Inside are 3 boxes, each 50px wide (no margins).
  29. 29.🔁 What does this code print?
    let score = 8;
    if (score > 17) {
      console.log("You win");
    } else {
      console.log("Play again");
    }
    (a) You win (b) Play again
  30. 30.🔠 Which heading shows the SMALLEST text: <h2>, <h6>, <h5> or <h4>? (a) <h2> (b) <h4> (c) <h5> (d) <h6>
  31. 31.⚡ Which JavaScript word runs code when true? (a) alert() (b) let (c) if (d) for
  32. 32.📋 How many items does this list show?
    <ul>
      <li>Litchi</li>
      <li>Grapes</li>
    </ul>
  33. 33.📄 Where does <link rel="stylesheet"> go: in the head or in the body? (a) in the head (b) in the body
  34. 34.🔠 Which heading shows the BIGGEST text: <h3>, <h5>, <h2> or <h1>? (a) <h2> (b) <h5> (c) <h1> (d) <h3>
  35. 35.⚖️ What colour is the text of this element?
    <p class="red" id="main">Hi</p>
    CSS:
    #main { color: black; }
    p { color: purple; }
    (a) yellow (b) purple (c) black (d) green
  36. 36.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
    .box {
      width: 240px;
      padding: 5px;
      border: 1px solid black;
      margin: 15px;
    }
  37. 37.🔁 What is the LAST number this code prints?
    for (let i = 0; i < 15; i = i + 4) {
      console.log(i);
    }
  38. 38.⚖️ What colour is the text of this element?
    <h1 class="box" id="intro">Hi</h1>
    CSS:
    h1 { color: red; }
    h1 { color: yellow; }
    (a) white (b) red (c) green (d) yellow
  39. 39.💬 How many paragraphs show on the page?
    <!-- <p>Cricket is fun.</p> -->
    <!-- <p>I love mangoes.</p> -->
    <p>Our school trip</p>
  40. 40.📱 Responsive design means a page ___. (a) is only for laptops (b) has no pictures (c) fits every screen (d) never changes

Answer key

  1. True
  2. 3
  3. 148
  4. <a href="about.html">
  5. makes headings and lists
  6. <script>
  7. 1
  8. Yes
  9. <p>
  10. the later one
  11. script.js
  12. blue
  13. a slash /
  14. 3
  15. 4
  16. <h1>
  17. False
  18. <th>
  19. False
  20. text
  21. <h6>
  22. JavaScript
  23. 150
  24. My pets
  25. an element selector
  26. False
  27. 4
  28. 50
  29. Play again
  30. <h6>
  31. if
  32. 2
  33. in the head
  34. <h1>
  35. black
  36. 252
  37. 12
  38. yellow
  39. 1
  40. fits every screen

Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids