
HTML
Basic Interview Q&A
1. How do you add comments in HTML?
To insert a comment in HTML you can simply use the lesser than sign at the beginning and the greater than sign at the end like this: “<!- comment ->”.
2. Can you compare and contrast physical tags from logical tags?
Physical tags format and display the content inserted within the tags. They add style defined by the parameters while logical tags define the meaning or structure of the content within the tags.
3. What is the difference between HTML and HTML5?
HTML5 is the updated version of HTML. What makes this newer version of HTML better is the added features that support audio, video, and new styling elements which differ from the old version.
4. How can data be stored in HTML5?
There are two ways you can store data:
- Local storage - It keeps data safe, whenever someone exits the browser, the data doesn't get deleted.
- Session storage - Keeps the data only when someone is using the browser. As soon as the browser closes, the data is immediately erased.
5. What are tags?
Tags are elements in HTML that define and format content properly.
6. Must all HTML tags be closed?
No, not all tags need to be closed. There are self-closing tags such as , that don’t require closing tags.
7. How do you make text paragraphs or sections?
There are two HTML tags you can use to make sections or paragraphs:
- This is used to create a line to separate text.
- This is used to create a text paragraph
8. What are the different types of lists found in HTML?
Three types of lists can be found in HTML:
- Ordered lists - This type of list displays elements that are in numerical order or format. is the tag used to define this kind of list.
- Unordered lists - This kind of list display elements in bulleted form. is the tag used to define this kind of list.
- Definition list - This is a kind of list that displays elements in dictionary form. The tag is used to define definition lists.
9. What is semantics in HTML?
Semantics in HTML are styles used to define the meaning of content elements in webpages. It provides meaning to the tags and code written.
10. How do you align text in HTML?
There are two ways to align text in HTML:
Indentation - Here you can indent lists further than the parent list. This will determine the various elements that are contained.
CSS - The CSS text-align property sets the alignment of text contained inside a block element of the table.
11. How do you underline text in HTML?
You can underline text by simply using the tag.
12. Define an image map.
An image map is used for linking multiple web pages using a single image by using the tag. One can define the kind of shapes one wants to include in images.
13. Define what is white space?
White space is an empty sequence of space characters. It helps the browser merge multiple spaces into one single space and makes indentation easier.
14. Write a basic HTML template
A basic HTML structure template looks like this:
<head>
<title>Page title</title>
</head>
<body>Body of contents</body>
</html>```15. Where can you use hyperlinks?
You can use hyperlinks in text and images. The “href” attribute is the most commonly used to define HTML anchor tags.
Example:
16. Define what DOM is
DOM is short for Document Object Model. DOM defines the following:
- HTML elements as objects
- Events of all HTML elements
17. How do you insert images into an HTML document?
You can insert an image by using the tag. Certain parameters are required for inserting images:
- src - used for adding a path to the image
- alt - for adding alternate text
- width - adds the image width
- height - adds the image height
Example:
18. Define the purpose of “ALT” in an image
Alternative text's sole purpose is to add the definition of what an image is all about.
19. What is a marquee?
Marquee is used for scrolling text on a web page. By using the tag, one can scroll either left, right, down, or up automatically.
20. What is a style sheet?
A style sheet helps in defining HTML templates. The templates can be linked to multiple pages, making it easy to maintain and update the website look.
21. How do you add a button in HTML?
You can add a button to an HTML page by using the button tag:
22. What are the types of headings you can use for your HTML doc?
There are about 5 types of headings that can be used. They can be defined by the following tags:
23. What is a span tag used for?
A tag is used for marking up a part of the text or document. It can also be used to group elements together for styling purposes.
24. Can you change the font color in HTML?
Yes, you can change the font color by using the tag. For example;
25. List the types of CSS that can be included in an HTML doc.
There are three types of CSS elements that can be included. These are:
- Inline CSS - This is used for styling small contents. It is mainly used for styling attributes inside the HTML elements in the body section.
- Internal CSS - This is used for adding tags in the section of the document. It is mainly for styling a single page that has a unique style.
- External CSS - This is used when applying to multiple pages.
26. What is the default size for the text field?
The default size for a text field is about 20 characters long. But if you include the size attribute one can set the size value to be as low as 1 and as high as the width of the browser width.
27. List the tags used to display data in the tabular form.
Below are the tags that can be used to display data:
- - tag defines the row
- - defines a table
- - defines the header
- - used to define data cell in a table
- - used for grouping the content in a table
- - used for grouping the header
- - used for grouping the footer in a table
28. Explain the typical layout of an HTML.
Every webpage has a specific layout but the following tags and elements are used in defining different sections of a webpage:
- - used to define the header section
- - used to define the document section
- - defines the navigation links container
- - used to define text aside from the content
- - used to define the footer of a document
29. Is a tag?
No, the is not a tag but a declaration. With it, HTML tags cannot function properly.
30. What is the advantage of collapsing the white space in HTML?
Collapsing whitespaces in HTML is beneficial because it reduces the time for transmitting information between the server and the client.
31. What color do clicked links appear?
The default for any link is blue. Once it has been clicked on, it turns purple.
Conclusion
To conclude, any HTML developer always needs to be well prepared for any question that the recruiter asks. The developer interviews come in different stages and the above-mentioned questions and answers are meant to address every stage of the interview, specifically the technical one.
With this comprehensive list of questions, both the interviewers and the interviewee can have a quick reference to intermediate and advanced levels of HTML questions.
If you are a new hirer looking for alternative methods of hiring, you can opt for Turing. The company helps you hire the world’s best talent remotely. For developers looking for HTML jobs, Turing test is the route to go!
Hire Silicon Valley-caliber HTML developers at half the cost
Turing helps companies match with top quality remote JavaScript developers from across the world in a matter of days. Scale your engineering team with pre-vetted JavaScript developers at the push of a buttton.
Tired of interviewing candidates to find the best developers?
Hire top vetted developers within 4 days.
Leading enterprises, startups, and more have trusted Turing
Check out more interview questions
Hire remote developers
Tell us the skills you need and we'll find the best developer for you in days, not weeks.





