Intermediate HTML & CSS test (Intermediate)
30 questions · 35 minutes · Free
Grid, responsive design, accessibility, Sass and CSS variables.
Take the Intermediate HTML & CSS test
What it covers
- CSS Grid
- Responsive design and media queries
- Accessibility and ARIA
- Sass and SCSS
- CSS custom properties
Interview format
- Questions: 30 questions — 18 multiple choice, 12 multi-answer
- Time: 35 minutes, timed from the first question
- Difficulty: Intermediate
- Skill area: Frontend
- Price: Free
Earn a certificate
The Intermediate HTML & CSS test is one of the 6 tests of the WordPress Developer learning path. Pass it and the other 5 tests at 70% or more and readyforhires issues you a verifiable certificate in your name, with its own code and verify link to share or add to LinkedIn.
Sample questions
5 sample questions from the Intermediate HTML & CSS test, with the answers. Samples are taken out of the live test, so you will not meet these when you sit it.
How are CSS custom properties defined and accessed in CSS?
- Custom properties are defined with the # prefix and accessed using the get() function.
- Custom properties are defined in a separate CSS file and accessed using the import() function.
- The CSS custom property is defined using the -- prefix, and its value can be accessed using the var() function.
- Custom properties are defined using the @custom-property keyword and accessed with the custom() function.
Answer: C. The CSS custom property is defined using the -- prefix, and its value can be accessed using the var() function.
CSS custom properties are defined with the -- prefix and accessed with var(). They provide a way to store reusable values and make styles more maintainable. Other options may describe incorrect syntax or usage.
A screen reader user is unable to understand the purpose of an icon in a web application. How should this issue be resolved?
- Use the title attribute on the icon element for screen reader support.
- Wrap the icon in a button element and rely on default keyboard navigation.
- Apply a CSS class to the icon for styling purposes only.
- Add the aria-label attribute to the icon element with a descriptive text.
Answer: D. Add the aria-label attribute to the icon element with a descriptive text.
To ensure accessibility for screen readers, icons should have an aria-label attribute that describes their purpose. This allows users who rely on assistive technologies to understand the function or meaning of the icon. Other options are incorrect because they do not address the specific issue of providing a label for icons.
Which of the following CSS Grid techniques allows for a responsive layout where the number of columns adjusts automatically based on available space, with each column having a minimum and maximum width?
- Grid template columns shorthand
- Grid auto-fit and minmax usage
- Grid line numbering
- Grid row alignment
Answer: B. Grid auto-fit and minmax usage
The 'grid-template-columns: repeat(auto-fit, minmax(200px, 1fr))' syntax is used to create a responsive grid layout that automatically adjusts the number of columns based on available space, ensuring each column is at least 200px wide and can grow to fill the remaining space. This is a common use case for 'grid auto-fit' and 'minmax' in CSS Grid.
You are designing a responsive layout using CSS Grid and need to align multiple rows of content evenly along the vertical axis, with the first row at the top and the last row at the bottom, leaving space between them. Which CSS property and value would you use to achieve this?
- align-content: space-between;
- justify-content: flex-start;
- align-items: center;
- grid-template-rows: auto;
Answer: A. align-content: space-between;
The align-content property is used to align grid items along the row axis (vertical direction) in a grid container. When set to 'space-between', it distributes the grid items evenly along the row axis, with the first item aligned to the start and the last item aligned to the end. This is a realistic use case for aligning content in a grid layout.
Which ARIA attribute is used to provide a label for a button when the button does not have visible text, such as an icon?
- aria-label
- aria-describedby
- aria-hidden
- aria-labelledby
Answer: A. aria-label
The aria-label attribute is used to provide a label for buttons when the button does not have visible text. It is particularly useful for icons or other non-text content that serve as buttons. Other attributes like aria-labelledby or aria-describedby are used for different purposes, and aria-label is the correct choice for directly labeling a button.
Frequently asked questions
- How many questions are in the Intermediate HTML & CSS test?
- 30 questions (18 multiple choice, 12 multi-answer), with 35 minutes to answer them.
- What does the Intermediate HTML & CSS test cover?
- CSS Grid, Responsive design and media queries, Accessibility and ARIA, Sass and SCSS, CSS custom properties.
- Is the Intermediate HTML & CSS test free?
- Yes. It is free to take with a readyforhires account.
- What level is the Intermediate HTML & CSS test?
- Intermediate, in Frontend.