Probably one of the currently most popular and respected IT-related job positions is a web developer. Web developers are needed every single day, for companies small and large. Since everything and anything nowadays is based on the internet, HTML-savvy developers are what the job market requires. Some employers offer huge salaries, others - various job benefits. However, before you decide on asking for that job interview, you should probably get to know the HTML interview questions that you might encounter.
Table of Contents
- 1. The Fundamentals of HTML
- 1.1. Question 1: What is HTML?
- 1.2. Question 2: What is a tag?
- 1.3. Question 3: What’s the difference between ‘physical tags’ and ‘logical tags’?
- 1.4. Question 4: Should you close all of your tags?
- 1.5. Question 5: What’s an ‘attribute’?
- 1.6. Question 6: Name a few semantic tags that were introduced with HTML5.
- 1.7. Question 7: Why are some characters often displayed as boxes?
- 1.8. Question 8: How many types of headings can HTML document support?
- 1.9. Question 9: What’s the difference between ‘block’ and ‘inline’ elements?
- 1.10. Question 10: What’s XHTML?
- 1.11. Question 11: How would you group form elements?
- 1.12. Question 12: What is an ‘image map’ used for?
- 1.13. Question 13: Should you collapse white spaces?
- 1.14. Question 14: What are ‘anchor’ tags?
- 1.15. Question 15: Do all browsers support HTML5?
- 2. Advanced HTML Questions
- 2.1. Question 1: What are ‘semantic elements’?
- 2.2. Question 2: How is data stored in HTML5?
- 2.3. Question 3: What happens if two sets of tags overlap each other?
- 2.5. Question 6: What is an ‘application cache’?
- 2.6. Question 7: What is a ‘marquee’?
- 2.7. Question 8: What are APIs?
- 2.8. Question 9: What’s the difference between normal links and active links?
- 2.9. Question 10: What’s WebSQL?
- 2.10. Question 11: What is an ‘entity’?
- 2.11. Question 12: What is ‘cite’?
- 2.12. Question 13: Does HTML5 support videos?
- 2.13. Question 14: What is the default size for a text field?
- 2.14. Question 15: A portion of a text seems to climb out of the page boundaries. Why is that?
- 3. Summary
The Fundamentals of HTML
Interviewers usually ask the basic questions at the beginning of the interview to avoid a rough start and to help you to find your voice and footing in the interview. After the basics, we'll transition to some of the more advanced interview questions that you're most likely to receive.
Latest Coursera Coupon Found:
Selected Coursera Courses
Take advantage of 100% free online Degrees and Certificates on Coursera & master your skills. Follow this Coursera coupon link to access the courses.
Question 1: What is HTML?
Now you might be thinking - why on Earth would I be asked such a thing? And indeed, it does seem strange that you would be asked this question in a… Web developer’s job interview, doesn’t it?
Well, it’s not strange at all. By asking this type of question, your potential employers simply want to test your skills in defining things in your own, personal words. They want to see how you think and how you approach such tasks.
To put it in a very simple manner, HTML is the language of the internet. Abbreviation for “Hypertext Markup Language”, it is the language used to create websites, web apps, and so on.
Question 2: What is a tag?
These types of definition-requiring HTML interview questions are quite common in the beginning, but don't try to memorize: instead, explain in your own words.
Tags are symbols between which the content is placed. They are used to shape and format the content so that it would make sense when released to the live version of the webpage.
Question 3: What’s the difference between ‘physical tags’ and ‘logical tags’?
Comparison-type HTML interview questions are also very common in web development job interviews, so take notes.
The content that is placed in between physical tags will be formatted and displayed according to those tags (to their parameters) by adding style. Logical tags set the meaning and importance of the text that they encompass.
<p style="color: blue";><it>These are physical tags, describing the appearance.</it></p>
<em>These are logical tags, describing that is an emphasized paragraph.</em>
Question 4: Should you close all of your tags?
Although at first, it might come off as obvious, this is one of the more sneaky HTML interview questions.
No, not all of the tags should be closed: not all HTML tags require a closing tag.
Question 5: What’s an ‘attribute’?
An attribute is simply an additional function that a tag has. This function sets a certain way in which the tag functions in the live version of a webpage.
These attributes are assigned to the tags in the same area in which the name of the tag is displayed.
Example: adding width to an image:
<img src="https://cdn.bitdegree.org/learn/pom-laptop.png?raw=true" width="100">
Question 6: Name a few semantic tags that were introduced with HTML5.
As you’ve probably know, HTML5 is the newest and current version of HTML, so it's no wonder you will have to talk about HTML5 in your HTML interview questions.
There were many different semantic tags introduced with the new version of HTML, but just to name a few examples: header, footer, main, article.
If you want to know about all of the new elements, read our HTML5 semantic tags guide.
Question 7: Why are some characters often displayed as boxes?
This is quite an often occurrence - this happens because some certain characters might not be supported by the web browser that your operating system is running.
Question 8: How many types of headings can HTML document support?
HTML supports six different types of headings. These headings differ in size, with Heading 1 being the largest (usually reserved for the title) and thus descending in size with each heading after that. You can read more about the headings here.
<h1>Heading text - Level 1. Most Important Heading</h1>
<h2>Heading text - Level 2</h2>
<h3>Heading text - Level 3</h3>
<h4>Heading text - Level 4</h4>
<h5>Heading text - Level 5</h5>
<h6>Heading text - Level 6. Least Important Heading</h6>
Question 9: What’s the difference between ‘block’ and ‘inline’ elements?
Block elements are programmed so that they would take up as much space as possible. As opposed to that, inline elements are designed to take up a very minimal amount of space.
You can read more about these elements and their differences here.
Question 10: What’s XHTML?
This might either be one of the fifth version HTML interview questions, or it could be completely unrelated to the topic. This is because it deals with the different versions of HTML.
XHTML is used to extend the most popular versions of HTML.
Question 11: How would you group form elements?
If you want to collect and transfer certain form HTML elements into a single group, the fieldset tag is considered to be the best one to use.
You can read more about this tag here.
Question 12: What is an ‘image map’ used for?
An image map is a tool that lets you place many different links on one, specific image. This is great because it lets you create awesome banners and website cover images while providing the ability to link anything you’d like.
<areashape="rect"coords="34, 44, 270, 350"alt="Doggo"href="https://www.bitdegree.org">
<areashape="rect"coords="290, 172, 333, 250"alt="Gaming"href="http://www.bitdegree.org">
<areashape="circle"coords="337, 300, 44"alt="Level up"href="http://www.bitdegree.org">
Question 13: Should you collapse white spaces?
This might come off as one of the trick HTML interview questions, simply because of the wording. But don’t get fooled - collapsing white spaces is considered to be quite beneficial.
In HTML, white spaces are considered to be characters, too. That means that they take up space. If you collapse them, you might be able to improve the readability of your project.
Question 14: What are ‘anchor’ tags?
Anchor tags are used to create hyperlinks. These links are created on an already existing piece of content (text). In total, there are three types of anchor tags - active, visited and unvisited.
You can see an example of such links here.
Question 15: Do all browsers support HTML5?
Well, yes and no, depending on what *all* means. Most of the current browsers do support HTML5 without a problem. However, this might not be the case with older versions of these browsers.
Advanced HTML Questions
Once you’re finished with the basics, your interviewers will probably want to transition to the more advanced questions. That’s why now we’ll cover some notable HTML interview questions and answers for experienced developers. These will determine how well you know HTML, and just how much preparation you’ve put into the web developer’s job interview.
Question 1: What are ‘semantic elements’?
While simple elements (tags) aim to define what a webpage should look like, semantic elements further this with actually bringing meaning into the webpage. Examples of semantic elements: <form> , <table> , and <article>. As you can see they clearly show what kind of content is going to be contained within.
Question 2: How is data stored in HTML5?
There are two ways to store data in HTML5 - with local storage and with session storage.
During the HTML interview questions knowing all of its' versions features is vital. Data that is stored in the local storage is safe and will not be eliminated after the developer decides to exit the browser. In session storage, once you exit the browser, the data is automatically deleted.
Question 3: What happens if two sets of tags overlap each other?
If you accidentally overlap two or more sets of tags, you’ll probably notice it fast in the live version of the website.
If different tags overlap, only the first tags are activated in the live version of the website. The way that you can check this is by going to the actual webpage and checking your content for possible errors and inconsistencies.
You can learn more about it here.
Question 6: What is an ‘application cache’?
An application cache is a function that allows you to run your project (website) in an offline mode. This is great for testing since it can load your resources in a much faster manner.
Question 7: What is a ‘marquee’?
A marquee is a function that allows you to add a scrollable text into your webpage. The way that you would do this is by inserting that text into the "marquee" tags.
Question 8: What are APIs?
This is one of the more often asked fifth version HTML interview questions. An API is an Application Programming Interface. These interfaces are used to create web applications. APIs use pre-existing tools and components, so that allows the developers to integrate them into their websites.
Question 9: What’s the difference between normal links and active links?
Normal links are those which appear in blue (if there were no additional styling added). These links may become active once a mouse cursor is placed unto them.
Question 10: What’s WebSQL?
WebSQL is a database that stores certain specific information about the people that come to visit/register on your webpage. The database stores their search preferences, certain actions and so on. An important point here is that WebSQL does not store any passwords, credit card information, etc. Remember to mention this if you get such interview questions on HTML.
Question 11: What is an ‘entity’?
If you get asked this or similar HTML interview questions, keep in mind that your employer is probably talking about special characters that HTML does not support. Entities are like placeholders - they fill a certain area in the file where another type of character should be. However, since the web browser does not support that character, you have to rely on an entity.
Question 12: What is ‘cite’?
The “cite” tag is used to - you’ve guessed it - mark a certain area of a text that has been taken from somewhere else. It’s an inline tag that simply shows cited text.
<cite>Sophie's Choice</cite> by William Styron
Question 13: Does HTML5 support videos?
Yes, it supports videos in three separate formats - MP4, OGG and WebM.
Question 14: What is the default size for a text field?
This might also come off as one of the trick HTML interview questions, for not many people think about it and might be surprised by this question.
The answer is pretty simple, though - the maximum amount of character that can be present in an unaltered text field is 13.
- Simplistic design (no unnecessary information)
- Good quality of courses (even the free ones)
- A few different features to choose from
- Nanodegree Program
- Suitable for enterprises
- Paid Certificates of completion
Question 15: A portion of a text seems to climb out of the page boundaries. Why is that?
Normally, this situation is almost impossible - HTML has clearly defined boundaries that are set so that texts or images couldn’t pass them. However, on a rare occasion, a text might climb out of those boundaries. This is usually the case when the text was typed in a table that has some wrong set parameters (especially in width).
At this point, you should have a better understanding of both the basics and the HTML interview questions and answers for experienced developers.
Needless to say, it would probably be impossible to cover all of the possible questions and their variations that you might get during your job interview - that would require a whole book series.
Make sticky notes, revise different variations of these questions, practice the actual coding itself and you’ll be golden. If you need any additional knowledge about HTML head over to BitDegree learn section. Once you feel confident with your skills, all of the stress and anxiety that the interview causes will be gone - guaranteed.