Final exam
HTML and CSS Basics
Before you start
- 20 questions, drawn at random from a pool of 32.
- Pass mark: 70%. Your final score is 30% practice + 70% exam.
- No time limit, but finish within 3 hours. You can move between questions before you submit.
- Failed? Review the lessons and try again: every attempt gets a new set of questions.
Question 1 of 20Match the pairs
Match each web language with its main job.
Tap an answer, then tap the place where it belongs (or drag it there).
- HTML
- CSS
- JavaScript
Question 2 of 20Choose one
What does a browser build from the HTML it receives, before applying CSS and painting the page?
Question 3 of 20True or false
A link with href="../about.html" points to a file named about.html in the parent folder of the current page.
Question 4 of 20Spot the mistake
Tap the line that is nested incorrectly.
Question 5 of 20Choose one
Which element sets the text shown in the browser tab and as the headline in search results?
Question 6 of 20Sort into groups
Sort each element: void element (no closing tag) or normal element?
Tap an item, then tap its group (or drag it there).
Question 7 of 20Choose one
What is the best heading structure for a page about dog training with sections on puppies and adult dogs?
Question 8 of 20Fill in the blanks
Fill in the blanks
A link that jumps to <section id="prices"> on the same page uses href="".
Question 9 of 20Choose one
What alt text is best for a decorative swirl image that adds no information?
Question 10 of 20Match the pairs
Match each image to the most suitable format.
Tap an answer, then tap the place where it belongs (or drag it there).
- A photo of a beach
- A logo that must stay sharp at any size
- A screenshot with fine text
Question 11 of 20True or false
Using a table to place a sidebar next to the main content is good practice because tables align things neatly.
Question 12 of 20Spot the mistake
Tap the line that leaves a form field without a proper label.
Question 13 of 20Choose one
Which input type shows a number pad on most phones and is meant for phone numbers?
Question 14 of 20Select all that apply
Which elements are semantic, describing the role of their content? Select all that apply.
Select all that apply.
Question 15 of 20Work it out
What is the specificity score of the selector #menu .item a using IDs × 100 + classes × 10 + types?
Question 16 of 20Choose one
Two rules target the same paragraph: .note { color: blue; } appears first and .note { color: green; } appears later. What color is the text?
Question 17 of 20True or false
Setting font-family on the body element usually changes the font of paragraphs and headings inside it too.
Question 18 of 20Work it out
With a 16 px root font size, how many pixels is 0.875rem?
Question 19 of 20Choose one
Which CSS value describes a pure blue color?
Question 20 of 20Choose one
What is the minimum contrast ratio WCAG recommends for normal-size body text?
Question 21 of 20Work it out
A box has width: 400px; padding: 25px; border: 5px solid; with the default content-box sizing. What is its visible width in pixels?
Question 22 of 20Fill in the blanks
Fill in the blanks
With box-sizing: , an element's declared width includes its padding and border.
Question 23 of 20Sort into groups
Sort each property into whether it works on a plain inline element like a span.
Tap an item, then tap its group (or drag it there).
Question 24 of 20Choose one
In a flex container with the default flex-direction: row, which property spaces items out along the row?
Question 25 of 20What would you do?
What would you do?
A developer writes .toolbar { justify-content: space-between; } but the buttons stay bunched on the left. What is the most likely fix?
Question 26 of 20Work it out
A flex container has 240 px of extra space to share between two items with flex-grow: 1 and flex-grow: 3. How many extra pixels does the second item get?
Question 27 of 20Work it out
A grid container is 1,030 px wide with grid-template-columns: repeat(3, 1fr) and a 15 px gap. How wide is each column, in pixels?
Question 28 of 20Choose one
Which line creates a responsive card grid that fits as many columns of at least 250 px as the screen allows?
Question 29 of 20Sort into groups
For each layout task, pick the CSS layout system that fits it best.
Tap an item, then tap its group (or drag it there).
Question 30 of 20Choose one
What does <meta name="viewport" content="width=device-width, initial-scale=1"> do?
Question 31 of 20Put in order
In a mobile-first stylesheet, put these rules in the order they should appear.
Drag the items, or use the arrow buttons, to put them in order.
- @media (min-width: 1000px) rules for a three-column layout
- Base styles for all screens, with a single-column layout
- @media (min-width: 600px) rules for a two-column layout
Question 32 of 20Select all that apply
Which changes are likely to make a simple website load faster? Select all that apply.
Select all that apply.