← Web development final test lesson New set →

Web Development Worksheet: Final Test

HTML and CSS lesson 30: Web development final test · Set 766 · 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.⚖️ What colour is the text of this element?
    <p class="big" id="hero">Hi</p>
    CSS:
    .big { color: red; }
    #hero { color: blue; }
    (a) blue (b) black (c) green (d) red
  2. 2.🔐 Is Blue@Tiger_74 a strong or a weak password? (a) weak (b) strong
  3. 3.🔁 What is the LAST number this code prints?
    for (let i = 0; i < 9; i = i + 4) {
      console.log(i);
    }
  4. 4.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Riya’s Recipes</title>
    </head>
    <body>
      <h1>Match report</h1>
      <p>Here is my best one.</p>
    </body>
    </html>
    (a) Riya’s Recipes (b) index.html (c) Match report (d) Here is my best one.
  5. 5.⚖️ What colour is the text of this element?
    <h1 class="big" id="intro">Hi</h1>
    CSS:
    h1 { color: blue; }
    h1 { color: red; }
    (a) orange (b) blue (c) red (d) green
  6. 6.🔗 Which code links to about.html? (a) <a src="about.html"> (b) <a alt="about.html"> (c) <a href="about.html"> (d) <link about.html>
  7. 7.🌈 Which hex code is cyan? (a) #ff00ff (b) #00ffff (c) #ffff00 (d) #0000ff
  8. 8.🔁 How many times does this code print “Well done”?
    for (let i = 1; i < 8; i++) {
      console.log("Well done");
    }
  9. 9.🖌️ Which CSS property picks the font style? (a) font-weight (b) color (c) font-family (d) text-align
  10. 10.🌗 Is dark grey on white easy or hard to read? (a) hard to read (b) easy to read
  11. 11.📄 Can HTML on its own make headings? (a) No (b) Yes
  12. 12.🔗 Which address opens when you click this link?
    <a href="games.html">Maths fun</a>
    (a) about.html (b) Maths fun (c) games.html (d) contact.html
  13. 13.True or false: in <img>, height sets how wide it is. (a) False (b) True
  14. 14.🔢 When you open a web page, what comes right after “the server sends files”? (a) the browser shows it (b) DNS finds the server (c) you type the URL (d) the browser asks it
  15. 15.🔗 Which address opens when you click this link?
    <a href="news.html">Maths fun</a>
    (a) games.html (b) Maths fun (c) news.html (d) quiz.html
  16. 16.📱 The screen is 540px wide. Does the rule inside @media apply?
    p {
      font-size: 12px;
    }
    @media (max-width: 768px) {
      p {
        font-size: 10px;
      }
    }
    (a) Yes (b) No
  17. 17.📱 The screen is 1100px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 16px;
    }
    @media (min-width: 1024px) {
      p {
        font-size: 22px;
      }
    }
  18. 18.🌈 Which hex code is bright green? (a) #0000ff (b) #ffffff (c) #00ff00 (d) #000000
  19. 19.📦 In the box model, which part is the text or picture? (a) content (b) padding (c) border (d) margin
  20. 20.📝 How many paragraphs does this code make?
    <p>My best friend</p>
    <h2>Rain today</h2>
    <p>Cricket is fun.</p>
  21. 21.🔁 How many times does this code print “Hello”?
    for (let i = 1; i <= 6; i++) {
      console.log("Hello");
    }
  22. 22.🌈 Which hex code is white? (a) #ffffff (b) #0000ff (c) #00ffff (d) #000000
  23. 23.🔁 What does this code print?
    let age = 48;
    if (age < 30) {
      console.log("teen");
    } else {
      console.log("child");
    }
    (a) teen (b) child
  24. 24.Which of these is true of <article>? (a) holds one blog post (b) holds the menu of links (c) holds a side box of tips (d) is the page’s key part
  25. 25.🔍 Which line is missing its closing tag?
    line 1: <u>My pets</u>
    line 2: <b>Our school trip</b>
    line 3: <h1>Fun facts
    (a) line 3 (b) line 2 (c) line 1
  26. 26.⚡ What does this code show?
    let name = "Arjun";
    alert("Hello, " + name + "!");
    (a) Arjun (b) Hello, name! (c) name (d) Hello, Arjun!
  27. 27.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as a dot (b) as one space (c) as a new line (d) as 5 spaces
  28. 28.🔢 On a typical page, from top to bottom, which comes FIRST? (a) <footer> (b) <main> (c) <nav> (d) <header>
  29. 29.🔠 How many heading levels does HTML have? (a) 10 (b) 4 (c) 6 (d) 3
  30. 30.True or false: to check for https first is safe. (a) True (b) False
  31. 31.🔁 Which loop repeats code a set number of times? (a) if (b) else (c) for (d) let
  32. 32.🚀 Which file should this code go in: h1 { font-size: 32px; } (a) script.js (b) style.css (c) index.html
  33. 33.🔁 How many times does this code print “Welcome”?
    for (let i = 0; i <= 2; i++) {
      console.log("Welcome");
    }
  34. 34.True or false: <img> goes in the body. (a) True (b) False
  35. 35.🖼️ Does <img> need a closing tag? (a) Yes (b) No
  36. 36.🔢 When you open a web page, which comes first: “the server sends files” or “DNS finds the server”? (a) the server sends files (b) DNS finds the server
  37. 37.🌐 Which one opens web pages for us? (a) a web server (b) a code editor (c) a web browser
  38. 38.🖼️ Which picture file does the browser load?
    <img src="moon.png" alt="The full moon" width="300">
    (a) The full moon (b) bus.jpg (c) fort.jpg (d) moon.png
  39. 39.🌗 Is light grey on white easy or hard to read? (a) easy to read (b) hard to read
  40. 40.🔁 How many times does this code print “Hello”?
    for (let i = 2; i <= 9; i++) {
      console.log("Hello");
    }

Answer key

  1. blue
  2. strong
  3. 8
  4. Riya’s Recipes
  5. red
  6. <a href="about.html">
  7. #00ffff
  8. 7
  9. font-family
  10. easy to read
  11. Yes
  12. games.html
  13. False
  14. the browser shows it
  15. news.html
  16. Yes
  17. 22
  18. #00ff00
  19. content
  20. 2
  21. 6
  22. #ffffff
  23. child
  24. holds one blog post
  25. line 3
  26. Hello, Arjun!
  27. as one space
  28. <header>
  29. 6
  30. True
  31. for
  32. style.css
  33. 3
  34. True
  35. No
  36. DNS finds the server
  37. a web browser
  38. moon.png
  39. hard to read
  40. 8

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