Web Development Test (HTML & CSS) By Seyi @Opus
NAME: …………………………………………………………………………………………………………………………………..
Multiple Choice Questions (20 Marks) Thick on your option.
Choose the correct option (A–D). Each question carries 1 mark.
1. Which HTML element is used to define the largest heading?
A. <h1>
B. <heading>
C. <h6>
D. <head>
2. Which attribute is used in HTML to open a link in a new tab?
A. target="_self"
B. target="_new"
C. target="_blank"
D. target="newtab"
3. Which of the following tags is used to create a dropdown list?
A. <input>
B. <ul>
C. <select>
D. <dropdown>
4. In CSS, which property is used to change the text color?
A. font-color
B. color
C. text-color
D. font-style
5. Which of the following HTML elements is semantic?
A. <div>
B. <span>
C. <article>
D. <b>
6. What is the default position value in CSS?
A. relative
B. absolute
C. static
D. fixed
7. Which attribute is used in HTML5 for form validation?
A. validate
B. check
C. required
D. must
8. What does CSS stand for?
A. Cascading Style Scripts
B. Cascading Style Sheets
C. Creative Style Sheets
D. Computer Style Sheets
9. Which CSS property is used to control the spacing between lines of text?
A. letter-spacing
B. line-height
C. text-spacing
D. word-spacing
10. Which tag is used to embed an image in HTML?
A. <img>
B. <image>
C. <picture>
D. <src>
11. Which CSS property is used to create rounded corners?
A. corner-radius
B. border-radius
C. round-corner
D. radius
12. Which HTML element is used to play video files?
A. <media>
B. <embed>
C. <video>
D. <play>
13. Which CSS selector will select only the element with id="main"?
A. .main
B. #main
C. main
D. *main
14. Which HTML tag is used for inserting a line break?
A. <break>
B. <lb>
C. <br>
D. <line>
15. Which CSS property is used to make text bold?
A. text-weight
B. font-weight
C. bold
D. font-style
16. Which of the following is not a valid HTML5 input type?
A. date
B. email
C. password
D. roll
17. What is the correct HTML for creating a hyperlink?
A. <a href="url">Link</a>
B. <link src="url">Link</link>
C. <href="url">Link</href>
D. <a url="link">Link</a>
18. Which CSS property is used to change the background color of an element?
A. color
B. background-color
C. bgcolor
D. background-style
19. In CSS, how do you select all <p> elements inside a <div>?
A. div p { }
B. p div { }
C. .div p { }
D. #div p { }
20. Which of these units is relative to the parent element’s font size?
A. px
B. %
C. em
D. cm
Coding / Short-Answer Questions (10 Marks)
Answer briefly or write code where required. Each carries 1 mark.
21. Write the HTML code to create a table with 2 rows and 3 columns.
22. Write the HTML code to embed an external CSS file called [Link].
23. Using CSS, write a rule to make all <h2> headings have red text and center alignment.
24. Write the HTML code for a form that contains: a text input for "Name", an email input for "Email", and a submit button.
25. Write CSS code to make all paragraphs have blue text, font-size 18px, and line-height 1.6.
26. Write the HTML code to insert an image [Link] with alternative text "Company Logo" and width 200px.
27. Write the CSS code to create a class .btn with:
• green background
• white text
• padding of 10px 20px
• rounded corners
28. Write the HTML5 code to embed an audio file named song.mp3 with controls.
29. Write the CSS code to make a <div> positioned fixed at the top-right corner of the page.
30. Write the HTML structure for a basic webpage including:
<!DOCTYPE html>, <html>, <head>, <title>, <body>.
GOOD LUCK, YOUR SCRIPT AND SCORE WOULD BE
WRITTEN ON THE BOARD.