Complete_HTML_Interview_Questions
Complete_HTML_Interview_Questions
1. What is HTML?
HTML stands for HyperText Markup Language. It is used to create the structure of web pages.
Tags are used to define elements in an HTML document, like <p>, <h1>, <div>, etc.
An HTML document starts with <!DOCTYPE html>, followed by <html>, <head>, and <body> tags.
Block-level elements take up the full width (like <div>, <p>), inline elements take only as much width as
The <head> tag contains metadata like title, styles, and links to scripts or CSS.
The <body> tag contains the content that is displayed on the web page.
Semantic elements clearly describe their meaning in a human- and machine-readable way, like <article>,
HTML Interview Questions and Answers
<section>, <footer>.
<ol> is for ordered lists, <ul> is for unordered lists, and <li> defines list items.
Using the <img> tag with src and alt attributes. Example: <img src='image.jpg' alt='Image'>
The <form> tag is used to collect user input with input fields, checkboxes, radio buttons, etc.
id is unique to one element, while class can be used for multiple elements.
An iframe allows you to embed another HTML page within the current page using the <iframe> tag.
Tags that do not have closing tags. Examples: <br>, <hr>, <img>, <input>.
It provides alternative text if the image can't load and helps with accessibility.
A hyperlink is a link from one page to another, created using the <a> tag.
HTML5 is the latest version of HTML with new tags like <video>, <audio>, <canvas>, and semantic elements.
They are used to store extra information on HTML elements that can be used in JavaScript.