← Web development final test lesson New set →

Web Development Worksheet: Final Test

HTML and CSS lesson 30: Web development final test · Set 444 · 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.🌈 How many pairs of hex digits are in a colour like #ff8800? (a) 2 (b) 4 (c) 6 (d) 3
  2. 2.🎯 How many elements on a page should have the same id? (a) any number (b) 2 (c) 5 (d) 1
  3. 3.⚖️ What colour is the text of this element?
    <p class="star" id="top">Hi</p>
    CSS:
    p { color: purple; }
    #top { color: red; }
    (a) black (b) red (c) white (d) purple
  4. 4.💪 How wide (px) is each gap between two boxes?
    .row {
      display: flex;
      width: 140px;
      justify-content: space-between;
    }
    Inside are 3 boxes, each 40px wide (no margins).
  5. 5.✍️ Which property is set to 20px in this rule?
    li {
      font-size: 20px;
      text-align: center;
      width: 300px;
    }
    (a) text-align (b) background-color (c) font-size (d) 20px
  6. 6.True or false: to tell a trusted adult is safe. (a) True (b) False
  7. 7.📝 How many paragraphs does this code make?
    <p>Hello, world!</p>
    <h2>Fun facts</h2>
    <p>Cricket is fun.</p>
    <p>Hello, world!</p>
    <p>Rain today</p>
  8. 8.🔁 What is the LAST number this code prints?
    for (let i = 0; i < 8; i = i + 3) {
      console.log(i);
    }
  9. 9.📋 Which list suits a shopping list in any order? (a) <br> (b) <ol> (c) <hr> (d) <ul>
  10. 10.🎯 What kind of selector is #hero? (a) an id selector (b) a class selector (c) an element selector
  11. 11.⚖️ Two rules with the same selector set a colour. Which one wins? (a) neither (b) the later one (c) the first one (d) the shorter one
  12. 12.📄 What is the first line of an HTML5 page? (a) <body> (b) <head> (c) <html> (d) <!DOCTYPE html>
  13. 13.📱 The screen is 375px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 16px;
    }
    @media (min-width: 768px) {
      p {
        font-size: 22px;
      }
    }
  14. 14.💬 How many paragraphs show on the page?
    <p>I love mangoes.</p>
    <p>Hello, world!</p>
    <!-- <p>My pets</p> -->
    <!-- <p>Fun facts</p> -->
  15. 15.🖌️ What colour are the letters?
    li {
      color: green;
      font-size: 16px;
      text-align: right;
      background-color: orange;
    }
    (a) green (b) orange (c) purple
  16. 16.🏷️ Every HTML tag starts with which sign? (a) < (b) { (c) [ (d) (
  17. 17.🖼️ How many pixels wide is the picture drawn?
    <img src="bus.jpg" alt="Our school bus" width="150">
  18. 18.🎨 A CSS file usually ends with which extension? (a) .png (b) .css (c) .js (d) .html
  19. 19.Which of these has a closing tag? (a) <h1> (b) <br> (c) <img> (d) <hr>
  20. 20.🌈 In #rrggbb, which colour do the first two digits give? (a) green (b) black (c) red (d) blue
  21. 21.🧭 Why use <nav> instead of <div> for a menu? (a) it makes text red (b) it adds pictures (c) it tells its meaning (d) it loads faster
  22. 22.🔠 Which tag is used for the main title on a page? (a) <h6> (b) <br> (c) <h1> (d) <p>
  23. 23.True or false: “use big enough text” helps everyone use the page. (a) True (b) False
  24. 24.🌗 Is pink on red easy or hard to read? (a) hard to read (b) easy to read
  25. 25.📋 Which list tag shows 1, 2, 3 numbers? (a) <ul> (b) <ol> (c) <li>
  26. 26.🔍 One closing tag is missing. Which one?
    <p>I love mangoes.</p>
    <small>The red kite
    <em>Our school trip</em>
    (a) </small> (b) </em> (c) </p> (d) </h3>
  27. 27.🔒 Is the connection to this address scrambled (encrypted)?
    http://www.example.net/maths/tables.html
    (a) Yes (b) No
  28. 28.📋 Which list tag is an ordered list? (a) <ul> (b) <li> (c) <ol>
  29. 29.📝 How many paragraphs does this code make?
    <p>Cricket is fun.</p>
    <p>Hello, world!</p>
    <p>Good morning!</p>
  30. 30.🖼️ Which picture file does the browser load?
    <img src="map.png" alt="Map of India" width="100">
    (a) Map of India (b) dog.jpg (c) map.png (d) cake.jpg
  31. 31.⚖️ What colour is the text of this element?
    <h2 class="menu" id="intro">Hi</h2>
    CSS:
    #intro { color: red; }
    .menu { color: green; }
    h2 { color: black; }
    (a) purple (b) black (c) green (d) red
  32. 32.🌐 Which one stores a website’s files? (a) a web server (b) a code editor (c) a web browser
  33. 33.🖼️ Does <img> need a closing tag? (a) No (b) Yes
  34. 34.🧩 Which language changes the text size? (a) CSS (b) HTML (c) JavaScript
  35. 35.💬 Which text will NOT show on the page?
    <p>My pets</p>
    <p>Good morning!</p>
    <!-- <p>My best friend</p> -->
    <p>Hello, world!</p>
    (a) My pets (b) Hello, world! (c) My best friend (d) Good morning!
  36. 36.✍️ In color: blue; which part is the value? (a) blue (b) : (c) color (d) ;
  37. 37.Which of these is true of a web browser? (a) turns HTML into a page (b) is where we type code (c) answers page requests (d) sends pages over the net
  38. 38.🔗 Where does this link open?
    <a href="https://example.com">Maths fun</a>
    (a) in a new tab (b) in the same tab
  39. 39.🚀 Which file should this code go in: #top { color: blue; } (a) style.css (b) index.html (c) script.js
  40. 40.🔠 Which heading shows the SMALLEST text: <h2>, <h1>, <h3> or <h5>? (a) <h2> (b) <h5> (c) <h3> (d) <h1>

Answer key

  1. 3
  2. 1
  3. red
  4. 10
  5. font-size
  6. True
  7. 4
  8. 6
  9. <ul>
  10. an id selector
  11. the later one
  12. <!DOCTYPE html>
  13. 16
  14. 2
  15. green
  16. <
  17. 150
  18. .css
  19. <h1>
  20. red
  21. it tells its meaning
  22. <h1>
  23. True
  24. hard to read
  25. <ol>
  26. </small>
  27. No
  28. <ol>
  29. 3
  30. map.png
  31. red
  32. a web server
  33. No
  34. CSS
  35. My best friend
  36. blue
  37. turns HTML into a page
  38. in the same tab
  39. style.css
  40. <h5>

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