Proficiency in HTML (and its latest version, HTML5) is essential for creating beautiful and functional websites that are easy to navigate and that provide a great user experience.
So, if you’re looking to hire a designer or web developer who’s experienced with HTML, you need to make sure their skills match your needs. The best way to do this is by building a skills-based hiring process, featuring skills tests and the right HTML interview questions.
TestGorilla’s here to help you with both. First, use our HTML5, CSS, or JavaScript tests to screen candidates and make sure they have the skills required for the role. Then, invite the best talent to an interview, where you can ask them some of the HTML interview questions you’ll find below.
Use the questions below to assess web designers’ and developers’ practical skills and experience with HTML. Our sample answers will guide you through the evaluation process, even if you’re not an expert in HTML.
The questions range from easy to more challenging, so you can adapt them to the seniority level of the role you’re hiring for.
HTML tags are the building blocks of HTML pages and define elements within a document, such as headings, paragraphs, links, and other content.
Each tag is enclosed by angle brackets, for example, <tagname>content</tagname>
. Most tags come in pairs, an opening tag and a closing tag, with a slash in the closing tag.
An HTML document starts with a <!DOCTYPE html>
declaration to specify the HTML version, followed by the <html>
element that wraps the entire content.
Inside <html>
, you have two main parts, he <head>
and the <body>
.
<head>
and <body>
?Use this question to follow up on the previous one. Here, candidates should explain that:
The <head>
section of an HTML document contains metadata (data about data) which includes the title of the document, scripts, stylesheets, and other resources that don’t show on the web page
The <body>
section contains all the content that appears on the web page, such as text, images, videos, and interactive elements
To set the document's title, you use the <title>
tag inside the <head>
section, like this: <title>Page title</title>
.
Metadata, which provides additional information about the HTML page, requires using <meta>
tags, also placed within the <head>
. For example, <meta charset="UTF-8">
defines the character encoding for the document.
Expect candidates to explain that:
An absolute URL is a complete web address that includes everything from the protocol (https) to the domain name and path to specific resources, such as https://www.example.com/photos/image.jpg.
A relative URL points to a file within the same website, omitting the protocol and domain name, like /photos/image.jpg or image.jpg if it’s in the same directory as the referencing document
HTML offers three types of lists:
Ordered lists (<ol>)
, which display elements in a numbered format
Unordered lists (<ul>), which display elements with bullet points for lists where the order of items does not matter
Description lists (<dl>)
, which list terms and their descriptions
A dropdown list in a form is created using the <select>
element, which contains multiple <option>
elements. Each <option>
represents a choice. Here’s a basic example:
<select name="colors"> <option value="red">Red</option> <option value="blue">Blue</option> <option value="green">Green</option> </select>
This code creates a dropdown list with options for red, blue, and green.
Applicants who have a solid grasp of HTML will know that they can use entities to display special characters on web pages that would otherwise be interpreted as HTML code. They start with an ampersand (&) and end with a semicolon (;).
For example:
&
displays an ampersand (&)
<
displays a less-than sign (<)
creates a non-breaking space in your text
Semantic HTML involves using HTML elements that clearly describe their meaning in a human- and machine-readable way. Instead of just showing content, semantic elements also express the structure and meaning of the webpage.
You can expect candidates to mention the following examples:
<header>
for introductory content or navigational links
<footer>
for the footer of a section or the page
<article>
for a self-contained composition like a blog post
<section>
for a themed section of content
<nav>
for navigation links
These elements make the page more accessible and improve SEO by helping search engines understand the content structure.
An <iframe>
is an HTML element you can use to embed another HTML document within a document. Web designers use it to insert content like videos, maps, or interactive content from different sources without disrupting the page’s layout. For example:
<iframe src="https://www.example.com" width="300" height="200"></iframe>
This code embeds a webpage from www.example.com with the specified dimensions.
<noscript>
tag?The <noscript>
tag defines alternative content (like a message or image) for users whose browsers do not support JavaScript or have it disabled. This ensures that the user sees a message if scripts do not run, for example:
<noscript> JavaScript is disabled on your browser. Please enable JavaScript to use all features of this site. </noscript>
HTML5 introduced several new input types to simplify data input and improve form usability. Examples that candidates might mention include:
email for email addresses
date for choosing dates
range for numeric values in a certain range
url for URLs
color for picking colors
These input types help with automatic validation and control the data format users can enter.
<!DOCTYPE html>
declaration?The <!DOCTYPE html>
declaration is the first line in an HTML document, placed before the <html>
tag. It tells the browser which version of HTML the page uses. In HTML5, it’s simply <!DOCTYPE html>
, indicating that the document uses HTML5.
This ensures that the browser renders the content correctly according to HTML5 standards.
<section>
, <article>
, <nav>
, and <aside>
elements?Skilled candidates will explain that:
<section>
defines document sections, such as chapters, headings, or any significant group of content
<article>
is for self-contained content that can be distributed independently, for example a blog article
<nav>
indicates major navigation blocks, like primary site navigation links
<aside>
is for content that is related to the content around it, such as sidebars, callouts, or advertisements
The History API enables JavaScript to manage the browser’s session history, i.e. the pages visited in the tab or frame of the current page.
This API uses methods like history.pushState() and history.replaceState() to add or modify history entries in Single Page Applications. It handles navigation without full page reloads, improving the user experience (UX) and page performance.
To gain deeper insight into applicants’ UX/UI skills, you can use our UX/UI Design test or ask them targeted UX interview questions.
HTML5 introduces form validation attributes that make client-side validation easy and straightforward without needing JavaScript.
Examples include:
required
to make a field mandatory
pattern
to define a regex pattern that the input must match
min
and max
for setting minimum and maximum values
maxlength
for specifying maximum length of text inputs
<label>
element?The <label>
element makes items more clickable and accessible in HTML forms.
Associating a <label>
with a specific form control (like an input, text area, or select) makes the control selectable by clicking the label text. This improves the user experience, especially for devices with smaller screens. It also enables screen readers to identify form controls, making forms more accessible.
Top candidates will know that in forms, there are three main types of buttons:
submit
, which submits data to the server
reset
, which clears all the input fields in the form to their initial values
button
, which enables various JavaScript interactions and doesn't inherently submit the form or reset its fields
To check whether applicants have a solid understanding of the basics of JavaScript, you can use our JavaScript for Entry-level Algorithms test.
To display high-quality images that look sharp on Retina or HiDPI screens, web developers can use the srcset attribute in the <img>
tag. This enables them to specify multiple image files and their pixel densities, meaning that the browser can download the appropriate image for the screen's resolution.
Candidates who have a strong grasp of SEO will know the best practices that help improve the visibility and ranking of HTML web pages. Expect them to mention the following:
Use semantic HTML tags like <header>
, <footer>
, <article>
, and <section>
to structure the content clearly
Ensure that each page has a unique and descriptive meta title and meta description
Use <header>
tags (H1, H2, H3, etc.) to structure content logically
Optimize images with an alt attribute, providing a clear description of the image content
Use keyword-rich URLs that are easy to understand but not too long
To further evaluate candidates’ skills, use our Technical SEO test.
Looking for more ideas? Below, we’ve picked 30 more interview questions you can use during interviews.
Again, we’ve ordered them by difficulty, so if you’re hiring for junior roles, pick questions from the top of the list. If you need more experienced candidates, use the bottom 10 to 15 questions.
How do you create a table in HTML?
What are inline, block, and inline-block elements?
What are forms and how are they used?
What are data attributes? How would you use them?
What is the purpose of the <canvas>
element?
How do you make an HTML form accessible?
How can you embed a video file in a webpage?
How can you create a navigation bar using HTML?
How do you implement audio content in HTML?
What are the new form elements in HTML5?
Explain the difference between contenteditable, spellcheck, and draggable attributes.
What is Geolocation in HTML5?
How do you use the localStorage and sessionStorage objects?
What is the figure tag? How is it used with the figcaption element?
What are Web Workers and when would you use them?
How do you use the progress and meter elements?
How do you handle file uploads in HTML forms?
How do you include JavaScript or CSS files in an HTML document?
What is the autocomplete attribute and how does it enhance usability?
Describe the fieldset and legend elements and their usage.
How do you disable an HTML form input?
Explain how to use placeholders in form fields.
How do you group related form inputs?
What is the datalist tag and how does it differ from a select element?
How do you make an HTML page print-friendly?
Explain the use of custom data attributes in HTML5.
How can you use HTML to improve the accessibility of a webpage?
How do you implement internationalization in HTML documents?
How do you handle deprecated HTML elements or attributes?
Explain how to create a multi-column layout using HTML.
For more inspiration, check out our:
HTML5 interview questions for HTML5-specific knowledge
UX interview questions to assess candidates’ experience with UX
Web design interview questions to evaluate the whole range of candidates’ web design skills
Web developer interview questions to evaluate applicants’ development skills
An in-depth talent assessment is the best way to evaluate applicants’ proficiency in HTML and make sure you’re making a hiring decision that’s based on data rather than on unconscious biases.
This approach enables you to put candidates’ skills first, rather than diplomas or resumes – which helps you lower your cost-per-hire and improve retention, according to more than 70% of employers we surveyed.
For the best results, use our HTML5 skills test and then invite top performers to an interview, where you can gain further insights into their technical skills and knowledge with the help of the right HTML interview questions.
Book a free live demo to chat with our team and see whether TestGorilla is the right fit for you. Or, if you prefer to test the platform first, simply sign up for our Free forever plan to start assessing applicants’ skills today.
Why not try TestGorilla for free, and see what happens when you put skills first.
Biweekly updates. No spam. Unsubscribe any time.
Our screening tests identify the best candidates and make your hiring decisions faster, easier, and bias-free.
This handbook provides actionable insights, use cases, data, and tools to help you implement skills-based hiring for optimal success
A comprehensive guide packed with detailed strategies, timelines, and best practices — to help you build a seamless onboarding plan.
This in-depth guide includes tools, metrics, and a step-by-step plan for tracking and boosting your recruitment ROI.
A step-by-step blueprint that will help you maximize the benefits of skills-based hiring from faster time-to-hire to improved employee retention.
With our onboarding email templates, you'll reduce first-day jitters, boost confidence, and create a seamless experience for your new hires.
Get all the essentials of HR in one place! This cheat sheet covers KPIs, roles, talent acquisition, compliance, performance management, and more to boost your HR expertise.
Onboarding employees can be a challenge. This checklist provides detailed best practices broken down by days, weeks, and months after joining.
Track all the critical calculations that contribute to your recruitment process and find out how to optimize them with this cheat sheet.