← Web development final test lesson New set →

Web Development Worksheet: Final Test

HTML and CSS lesson 30: Web development final test · Set 119 · 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.🔁 When does the else part run? (a) never (b) when if is false (c) always (d) when if is true
  2. 2.True or false: <meta charset="utf-8"> goes in the head. (a) True (b) False
  3. 3.🚀 Which program lets you see your web page while you build it? (a) a calculator (b) a music player (c) a photo viewer (d) a web browser
  4. 4.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as one space (b) as a dot (c) as 5 spaces (d) as a new line
  5. 5.🏷️ Is <title> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
  6. 6.🔁 Which loop repeats code a set number of times? (a) if (b) else (c) let (d) for
  7. 7.True or false: HTML makes headings and lists. (a) True (b) False
  8. 8.🌗 Is dark grey on white easy or hard to read? (a) easy to read (b) hard to read
  9. 9.📱 The screen is 700px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 16px;
    }
    @media (max-width: 768px) {
      p {
        font-size: 12px;
      }
    }
  10. 10.💬 Which text will NOT show on the page?
    <!-- <p>Fun facts</p> -->
    <p>I love mangoes.</p>
    <p>Hello, world!</p>
    (a) Fun facts (b) Hello, world! (c) I love mangoes.
  11. 11.📋 Which tag goes around each item of a list? (a) <ol> (b) <ul> (c) <p> (d) <li>
  12. 12.📝 At most, how many of these can be chosen at the same time?
    <form>
      <input type="checkbox" name="fruit"> Litchi
      <input type="checkbox" name="fruit"> Banana
      <input type="checkbox" name="fruit"> Guava
    </form>
  13. 13.📱 max-width: 600px applies when the screen is ___. (a) 600px or wider (b) turned off (c) exactly 1000px (d) 600px or narrower
  14. 14.💪 How much empty space (px) is before the first box?
    .row {
      display: flex;
      width: 340px;
      justify-content: center;
    }
    Inside are 3 boxes, each 100px wide (no margins).
  15. 15.🔁 What does i++ do? (a) prints i (b) doubles i (c) adds 1 to i (d) takes 1 from i
  16. 16.🔒 What does the lock (HTTPS) in the address bar mean? (a) the data is scrambled (b) the site is free (c) the site is a game (d) the site is fast
  17. 17.🔍 One closing tag is missing. Which one?
    <h2>My pets</h2>
    <i>I love mangoes.
    <h1>My best friend</h1>
    (a) </h1> (b) </h2> (c) </p> (d) </i>
  18. 18.True or false: <td> makes one data cell. (a) True (b) False
  19. 19.📱 The screen is 320px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 16px;
    }
    @media (max-width: 768px) {
      p {
        font-size: 14px;
      }
    }
  20. 20.🎨 Which tag connects an outside CSS file? (a) <link> (b) <img> (c) <css> (d) <a>
  21. 21.✍️ How does a CSS comment start? (a) <!-- (b) // (c) /* (d) #
  22. 22.🔠 How many headings are in this code?
    <h1>I love mangoes.</h1>
    <p>Hello, world!</p>
    <p>My pets</p>
    <h2>Our school trip</h2>
    <h2>Fun facts</h2>
  23. 23.📄 Can HTML on its own run a game loop? (a) Yes (b) No
  24. 24.True or false: h1 is an element selector. (a) False (b) True
  25. 25.🖌️ Which CSS property picks the font style? (a) text-align (b) font-family (c) color (d) font-weight
  26. 26.✍️ Which property is set to 2px solid in this rule?
    .note {
      text-align: center;
      border: 2px solid;
      font-style: italic;
    }
    (a) width (b) 2px solid (c) font-style (d) border
  27. 27.⚡ What does this code show?
    let name = "Riya";
    console.log("Welcome, " + name + "!");
    (a) Riya (b) Welcome, name! (c) name (d) Welcome, Riya!
  28. 28.📝 How many paragraphs does this code make?
    <p>I love mangoes.</p>
    <h2>Cricket is fun.</h2>
    <h2>Our school trip</h2>
  29. 29.🖼️ Does <img> need a closing tag? (a) Yes (b) No
  30. 30.⚡ Which tag holds JavaScript in a page? (a) <style> (b) <script> (c) <code> (d) <js>
  31. 31.📄 What is the first line of an HTML5 page? (a) <body> (b) <html> (c) <!DOCTYPE html> (d) <head>
  32. 32.🎨 Which attribute adds CSS inside one tag? (a) src (b) alt (c) href (d) style
  33. 33.📛 In <a href="x.html">, what is href? (a) an attribute (b) an element name (c) a comment (d) a closing tag
  34. 34.🌈 In #910000 the red part is the hex number 91. What is it as a normal number?
  35. 35.⚖️ Two rules with the same selector set a colour. Which one wins? (a) the first one (b) the shorter one (c) neither (d) the later one
  36. 36.✍️ What value is given to background-color in this rule?
    body {
      border: 2px solid;
      background-color: yellow;
      font-style: italic;
    }
    (a) 10px (b) 8px (c) background-color (d) yellow
  37. 37.🔠 Are headings shown in bold by default? (a) No (b) Yes
  38. 38.🌈 Which colour is #000000? (a) white (b) magenta (c) yellow (d) black
  39. 39.🔗 Where does this link open?
    <a href="about.html">Visit the site</a>
    (a) in the same tab (b) in a new tab
  40. 40.🔁 What does this code print?
    let age = 17;
    if (age >= 37) {
      console.log("teen");
    } else {
      console.log("child");
    }
    (a) child (b) teen

Answer key

  1. when if is false
  2. True
  3. a web browser
  4. as one space
  5. an opening tag
  6. for
  7. True
  8. easy to read
  9. 12
  10. Fun facts
  11. <li>
  12. 3
  13. 600px or narrower
  14. 20
  15. adds 1 to i
  16. the data is scrambled
  17. </i>
  18. True
  19. 14
  20. <link>
  21. /*
  22. 3
  23. No
  24. True
  25. font-family
  26. border
  27. Welcome, Riya!
  28. 1
  29. No
  30. <script>
  31. <!DOCTYPE html>
  32. style
  33. an attribute
  34. 145
  35. the later one
  36. yellow
  37. Yes
  38. black
  39. in the same tab
  40. child

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