This document contains 100 HTML questions covering various concepts, theory, and code. These questions will help you prepare effectively for an interview.
- Each section is collapsible to make navigation easier.
- Click on the section headers to expand and view the questions.
- Use this as a study guide to review important HTML concepts.
- Basic HTML
- Text Formatting
- Lists
- Links and Navigation
- Images
- Tables
- Forms
- Semantic HTML
- Multimedia
- HTML5 New Features
- HTML Attributes
- Responsive Design
- Accessibility
- Best Practices
- Advanced Topics
- Performance
Basic HTML
- What does HTML stand for?
- What is the purpose of the
<!DOCTYPE html>
declaration? - What are the main sections of an HTML document?
- What is the difference between an element and a tag?
- How do you write a comment in HTML?
- What is the purpose of the
<head>
element? - What is the purpose of the
<title>
element? - What is the purpose of the
<body>
element? - How do you create a hyperlink in HTML?
- What is the difference between an absolute URL and a relative URL?
Text Formatting
- How do you create a paragraph in HTML?
- How do you create a line break in HTML?
- How do you make text bold in HTML?
- How do you make text italic in HTML?
- How do you create a heading in HTML?
- How many levels of headings are there in HTML?
- What is the
<blockquote>
element used for? - How do you create a horizontal line in HTML?
- What is the
<pre>
element used for? - How do you create a superscript and subscript text in HTML?
Lists
- How do you create an unordered list in HTML?
- How do you create an ordered list in HTML?
- How do you create a list item in HTML?
- What is the difference between the
<ul>
and<ol>
elements? - How do you create a nested list in HTML?
Images
- How do you embed an image in an HTML page?
- What is the purpose of the
alt
attribute in an image tag? - How do you specify the dimensions of an image in HTML?
- How do you make an image a clickable link?
- What is the difference between inline and block-level elements?
Tables
- How do you create a table in HTML?
- How do you create a table row in HTML?
- How do you create a table cell in HTML?
- What is the purpose of the
<thead>
,<tbody>
, and<tfoot>
elements? - How do you merge cells in a table?
Forms
- How do you create a form in HTML?
- What is the purpose of the
<form>
element? - How do you create a text input field in HTML?
- How do you create a password input field in HTML?
- How do you create a radio button in HTML?
- How do you create a checkbox in HTML?
- How do you create a dropdown list in HTML?
- How do you create a submit button in HTML?
- What is the purpose of the
action
attribute in a form? - What is the purpose of the
method
attribute in a form?
Semantic HTML
- What is semantic HTML?
- Why is semantic HTML important?
- What is the
<article>
element used for? - What is the
<section>
element used for? - What is the
<nav>
element used for? - What is the
<aside>
element used for? - What is the
<header>
element used for? - What is the
<footer>
element used for? - What is the
<main>
element used for? - What is the
<figure>
and<figcaption>
elements used for?
Multimedia
- How do you embed a video in HTML?
- How do you embed an audio file in HTML?
- What is the purpose of the
<source>
element in multimedia? - How do you embed a YouTube video in HTML?
- What is the
<canvas>
element used for?
HTML5 New Features
- What are some new features introduced in HTML5?
- How do you create a date input field in HTML5?
- What is the
<datalist>
element used for? - What is the
<output>
element used for? - What is the
<progress>
element used for?
HTML Attributes
- What are attributes in HTML?
- How do you specify an attribute in an HTML tag?
- What is the purpose of the
id
attribute? - What is the purpose of the
class
attribute? - What is the purpose of the
style
attribute?
Responsive Design
- What is responsive design?
- How do you make an image responsive in HTML?
- What is the viewport meta tag, and why is it important?
- How do you create a responsive navigation menu?
- How do you use media queries in HTML?
Accessibility
- What is web accessibility?
- How do you make an HTML page accessible?
- What is the purpose of the
alt
attribute in images for accessibility? - How do you use ARIA (Accessible Rich Internet Applications) in HTML?
- What is the purpose of the
role
attribute in HTML?
Best Practices
- What are some best practices for writing HTML?
- Why is it important to validate your HTML code?
- How do you validate HTML code?
- What are meta tags, and why are they important?
- What is the purpose of the
<meta charset="UTF-8">
tag?
Advanced Topics
- What is the DOM (Document Object Model)?
- How do you manipulate the DOM using JavaScript?
- What is the difference between HTML and XHTML?
- What is the purpose of the
data-*
attributes? - How do you include a favicon in an HTML document?
Performance
- How do you optimize the performance of an HTML page?
- What is lazy loading, and how do you implement it in HTML?
- How do you defer the loading of JavaScript files in HTML?
- What is the purpose of the
async
attribute in script tags?