Reference Page: HTML|CSS|Java-Script|Angular|React

HTML Links : Learn     Interview Questions     Software IDE HTML Jobs : Indeed.com     ZipRecruiter.com     Monster.com

HTML Interview Questions - Page 1

Next Page >
Question: What is HTML?
Answer: HTML stands for Hypertext Markup Language. It's the standard markup language used to create web pages. HTML defines the structure and layout of a web page using a system of markup tags.

Question: What is the difference between HTML and XHTML?
Answer: The HTML (HyperText Markup Language) and XHTML (eXtensible HyperText Markup Language) are both markup languages used to create web pages. The main difference is that XHTML is a stricter and more XML-compliant version of HTML. XHTML requires well-formed documents with proper nesting and closing of tags, whereas HTML is more forgiving of syntax errors.

Question: What are the new features in HTML5 compared to previous versions of HTML?
Answer: HTML5 introduces several new features and elements, including semantic elements like <header>, <footer>, <nav>, <article>, and <section>.

It also includes new form input types (<input type="date">, <input type="email">, etc.), multimedia elements (<audio> and <video>), canvas for drawing graphics, local storage, and more.

Question: What is the purpose of the 'alt' attribute in an <img> tag?
Answer: The 'alt' attribute for an image provides alternative text for that image, which is displayed if the image fails to load or if the user is using a screen reader.

It also improves accessibility and helps search engines understand the content of the image for indexing purposes.

Question: What is the difference between <div> and <span> elements?
Answer: The <div> and <span> are both generic container elements used to group other elements, but they are used in different contexts.

The <div> is a block-level element used for grouping larger sections of content, while <span> is an inline-level element used for applying styles or grouping smaller units of content within a larger block of text.

Question: What is the purpose of the <meta> tag in HTML?
Answer: The <meta> tag is used to provide metadata about an HTML document.
It includes information such as:
• Character encoding: Like, <meta charset="UTF-8">
• Viewport settings for responsive design: Like, <meta name="viewport" content="width=device-width, initial-scale=1.0">
• Other metadata that can be used by browsers and search engines.

Question: Can you explain the difference between <ol>, <ul>, and <dl> elements?
Answer: Please find the difference below:
<ol> is used to create ordered lists (lists with a specific sequence or numbering)
<ul> is used to create unordered lists (lists without a specific sequence or numbering)
<dl> is used to create definition lists (lists of terms and their definitions)


Next Page >