← Web development final test lesson New set →

Web Development Worksheet: Final Test

HTML and CSS lesson 30: Web development final test · Set 90 · 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.🖼️ Which attribute of <img> shows if the image fails? (a) src (b) width (c) height (d) alt
  2. 2.True or false: <h1> has a closing tag. (a) True (b) False
  3. 3.✍️ Which sign goes between a property and its value? (a) - (b) ; (c) = (d) :
  4. 4.📋 Which list shows the steps of a recipe best? (a) <br> (b) <hr> (c) <ol> (d) <ul>
  5. 5.🔁 How many times does this code print “Well done”?
    for (let i = 1; i < 3; i++) {
      console.log("Well done");
    }
  6. 6.True or false: <meta> is an empty tag. (a) True (b) False
  7. 7.💬 How does an HTML comment end? (a) // (b) --> (c) */ (d) >>
  8. 8.⚡ Which JavaScript word shows a pop-up box? (a) alert() (b) for (c) if (d) console.log()
  9. 9.🏷️ Is </b> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
  10. 10.🔤 In “HTML”, what does the M stand for? (a) Machine (b) Modern (c) Mouse (d) Markup
  11. 11.🔠 How many headings are in this code?
    <h1>Our school trip</h1>
    <p>I love mangoes.</p>
    <p>Fun facts</p>
    <h2>Rain today</h2>
    <h2>Cricket is fun.</h2>
  12. 12.🖼️ Which attribute of <img> is read by screen readers? (a) height (b) alt (c) width (d) src
  13. 13.🔢 When you open a web page, which comes LAST? (a) the server sends files (b) you type the URL (c) the browser asks it (d) the browser shows it
  14. 14.🔁 How many times does this code print “Hello”?
    for (let i = 1; i < 8; i++) {
      console.log("Hello");
    }
  15. 15.💬 Which text will NOT show on the page?
    <p>Fun facts</p>
    <p>Our school trip</p>
    <!-- <p>My best friend</p> -->
    (a) Fun facts (b) Our school trip (c) My best friend
  16. 16.📱 min-width: 800px applies when the screen is ___. (a) 800px or wider (b) exactly 100px (c) 800px or narrower (d) turned off
  17. 17.⚖️ What colour is the text of this element?
    <p class="red" id="hero">Hi</p>
    CSS:
    #hero { color: white; }
    p { color: black; }
    (a) black (b) white (c) purple (d) blue
  18. 18.📝 On how many lines does the browser show this paragraph?
    <p>Stars shine<br>Roses are red<br>Rivers flow<br>Birds sing<br>Sky is blue</p>
  19. 19.🔁 How many times does this code print “Hi”?
    for (let i = 1; i <= 10; i++) {
      console.log("Hi");
    }
  20. 20.⚡ What number does this code print?
    let a = 34;
    let b = 34;
    console.log(a - b);
  21. 21.🔁 What number does this code print?
    let total = 0;
    for (let i = 1; i <= 9; i++) {
      total = total + i;
    }
    console.log(total);
  22. 22.🏷️ Every HTML tag starts with which sign? (a) < (b) { (c) ( (d) [
  23. 23.📄 What is the first line of an HTML5 page? (a) <body> (b) <!DOCTYPE html> (c) <html> (d) <head>
  24. 24.True or false: .menu is an id selector. (a) True (b) False
  25. 25.📊 Which tag makes one table row? (a) <th> (b) <td> (c) <table> (d) <tr>
  26. 26.📋 Does this list show bullets or numbers?
    <ul>
      <li>Jamun</li>
      <li>Litchi</li>
      <li>Papaya</li>
    </ul>
    (a) numbers (b) bullets
  27. 27.True or false: a code editor opens web pages for us. (a) False (b) True
  28. 28.📊 How many cells does this table have in all?
    <table>
      <tr><th>Name</th><th>Fruit</th><th>Price</th></tr>
      <tr><td>Grapes</td><td>Grapes</td><td>Mango</td></tr>
      <tr><td>Litchi</td><td>Litchi</td><td>Jamun</td></tr>
      <tr><td>Grapes</td><td>Litchi</td><td>Grapes</td></tr>
    </table>
  29. 29.📱 Which tag helps phones show a page at the right size? (a) the title tag (b) the viewport meta tag (c) the br tag (d) the hr tag
  30. 30.⚡ What does this code print? (Look at the quotes!)
    let x = "6";
    let y = 7;
    console.log(x + y);
    (a) 13 (b) Error (c) 67
  31. 31.✍️ Which sign ends each CSS declaration? (a) ; (b) . (c) , (d) :
  32. 32.💪 Which flexbox property lines boxes up across? (a) flex-direction (b) align-items (c) display: flex (d) justify-content
  33. 33.True or false: console.log(5 + 2); goes in script.js. (a) True (b) False
  34. 34.⚖️ What colour is the text of this element?
    <p class="menu" id="intro">Hi</p>
    CSS:
    #intro { color: red; }
    #intro { color: black; }
    (a) red (b) blue (c) purple (d) black
  35. 35.🔠 Which heading shows the BIGGEST text: <h3>, <h2>, <h5> or <h4>? (a) <h4> (b) <h5> (c) <h3> (d) <h2>
  36. 36.🌈 In #rrggbb, which colour do the last two digits give? (a) blue (b) green (c) red (d) white
  37. 37.💬 How many paragraphs show on the page?
    <p>Good morning!</p>
    <!-- <p>The red kite</p> -->
    <!-- <p>Hello, world!</p> -->
    <p>I love mangoes.</p>
    <!-- <p>Our school trip</p> -->
  38. 38.📱 The screen is 540px wide. Does the rule inside @media apply?
    p {
      font-size: 12px;
    }
    @media (max-width: 600px) {
      p {
        font-size: 10px;
      }
    }
    (a) Yes (b) No
  39. 39.🔗 Where does this link open?
    <a href="contact.html" target="_blank">About us</a>
    (a) in a new tab (b) in the same tab
  40. 40.📝 How many <input> tags are in this form?
    <form>
      <input type="date">
      <input type="text">
      <input type="submit" value="Send">
    </form>

Answer key

  1. alt
  2. True
  3. :
  4. <ol>
  5. 2
  6. True
  7. -->
  8. alert()
  9. a closing tag
  10. Markup
  11. 3
  12. alt
  13. the browser shows it
  14. 7
  15. My best friend
  16. 800px or wider
  17. white
  18. 5
  19. 10
  20. 0
  21. 45
  22. <
  23. <!DOCTYPE html>
  24. False
  25. <tr>
  26. bullets
  27. False
  28. 12
  29. the viewport meta tag
  30. 67
  31. ;
  32. align-items
  33. True
  34. black
  35. <h2>
  36. blue
  37. 2
  38. Yes
  39. in a new tab
  40. 3

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