HTML and CSS skill check
Check the HTML and CSS fundamentals that interviews still ask: semantics and accessibility, specificity, the box model, flexbox, grid, and responsive layout.
15
Questions
11 min
Timer can't pause
Multiple choice
current browsers
Choose a level
Topics
- Semantic HTML
- Accessibility
- Selectors and specificity
- Box model
- Flexbox
- Grid
- Responsive design
- Positioning
Do
Use scratch paper or a notepad to work things out. Skip a question and come back to it later.
Don't
Look up answers during the check. Open the check in more than one tab or window.
Easy · 15 questions · 11 min
By starting, you agree to the Terms and Privacy Policy.
Practice checks each answer as you go, with an explanation. The exam is checked when you submit; 9 of 15 passes and earns a certificate.
Checking your levels…
Certificates come from the certified exam: pass with 9 of 15 while signed in. View a sample certificate.
Sample HTML and CSS questions with answers
These are never used in a check, so seeing their answers here won't give anything away.
Question 1 · Easy · Semantic HTML
Which HTML5 element represents self-contained content that could be distributed or reused independently, such as a blog post, forum post, or news article?- A.
<article> - B.
<aside> - C.
<main> - D.
<section>
Show answer
A.
<article>The <article> element is intended to encapsulate a standalone composition that makes sense on its own. In contrast, <section> is a generic standalone section of a document without the requirement of independent reusability.- A.
Question 2 · Easy · Box model
An element haswidth: 200px,padding: 20px, 'border: 5px solid black', andbox-sizing: border-box. What is the total rendered width of the element's box (excluding margin)?- A.225px
- B.250px
- C.240px
- D.200px
Show answer
D. 200px
Withbox-sizing: border-box, the element's specified width includes its content, padding, and border. Thus, the total rendered outer width remains exactly 200px.Question 3 · Moderate · Positioning
A developer sets an element to 'position: sticky; top: 0;'. Inside the browser, the element scrolls along with the page and fails to stick to the top of the viewport. Which of the following is the most likely cause?- A.The element has a static height defined instead of
height: auto. - B.The sticky element does not have an explicit z-index assigned.
- C.An ancestor element has
overflow: hiddenor another non-visible overflow property. - D.The element's parent container uses
display: flex.
Show answer
C. An ancestor element has
overflow: hiddenor another non-visible overflow property.A sticky element sticks relative to its nearest scrolling ancestor. If an ancestor has overflow set to hidden, auto, or scroll, that ancestor establishes the scroll context, preventing the element from sticking relative to the viewport.- A.The element has a static height defined instead of
Question 4 · Advanced · Selectors and specificity
What is the calculated specificity vector (ID, Class/Attribute/Pseudo-class, Type/Pseudo-element) of the selector: :is(article, .card) > p:where(.featured, #highlight)?- A.(0, 2, 1)
- B.(1, 2, 1)
- C.(0, 1, 1)
- D.(1, 1, 1)
Show answer
C. (0, 1, 1)
:is() takes the specificity of its most specific argument (here, .card gives 0-1-0). :where() always contributes (0, 0, 0) regardless of its arguments. The type selector 'p' contributes 0-0-1. Thus, the total specificity is 0-1-1.
How scoring and certificates work
- Each check has 15 multiple-choice questions with one correct answer, and one timer for the whole check. A question you leave unanswered scores nothing.
- Practice is free without an account and shows whether each answer is right as you go, with an explanation.
- The certified exam is scored when you submit. 60% passes, which is 9 of 15. Easy unlocks Moderate, and Moderate unlocks Advanced.
- Passing the exam while signed in earns a free certificate, valid for one year, with its own verification page. See a sample certificate.
Free tools for HTML and CSS: HTML Formatter, CSS Formatter, CSS Gradient Generator, Color Contrast Checker