0% found this document useful (0 votes)
20 views2 pages

HTML Questions and Answers

The document provides a comprehensive overview of HTML, including its definition, tags, and key features of HTML5. It covers various elements such as hyperlinks, images, semantic tags, forms, and accessibility practices. Additionally, it explains the differences between certain HTML elements and attributes, highlighting their purposes and uses.

Uploaded by

jaibirmalik2023
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views2 pages

HTML Questions and Answers

The document provides a comprehensive overview of HTML, including its definition, tags, and key features of HTML5. It covers various elements such as hyperlinks, images, semantic tags, forms, and accessibility practices. Additionally, it explains the differences between certain HTML elements and attributes, highlighting their purposes and uses.

Uploaded by

jaibirmalik2023
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

HTML Questions and Answers

What is HTML?
HTML (HyperText Markup Language) is the standard markup language used to create web
pages. It structures the content using elements and tags.

What are HTML tags?


Tags are used to mark up the start and end of an HTML element. Example:
<p>Paragraph</p>. Tags usually come in pairs: an opening tag and a closing tag.

What is the difference between HTML and HTML5?


HTML5 is the latest version of HTML with new features like: support for audio/video, new
semantic tags, offline storage, and better mobile support.

How do you create a hyperlink in HTML?


<a href="https://example.com">Visit Example</a>

How do you insert an image in HTML?


<img src="image.jpg" alt="Description of image">

What is the use of the <head> tag?


It contains metadata such as title, links to stylesheets, and scripts that aren't displayed on
the page.

What is the difference between <div> and <span>?


<div> is a block-level element, while <span> is an inline element.

What are semantic tags?


Semantic tags clearly define their meaning in HTML5, like <article>, <section>, <header>,
<footer>.

What is the alt attribute in <img> tag?


It provides alternative text if the image can't load or for screen readers.

What is a self-closing tag?


A self-closing tag doesn't require a closing tag, e.g., <br>, <hr>, <img>, <input>.

How do you create a table in HTML?


<table><tr><th>Name</th><th>Age</th></tr><tr><td>John</td><td>25</td></tr></
table>

What is the difference between id and class?


id is unique to one element, class can be used on multiple elements.
How do you create a form in HTML?
<form action="/submit" method="post"><input type="text" name="name"><input
type="submit"></form>

What is the <iframe> tag used for?


It embeds another HTML page within the current one.

What is the purpose of the <meta> tag?


It provides metadata such as character set, viewport settings, and description.

What is the difference between <strong> and <b>?


<strong> indicates importance; <b> just styles text as bold.

What are data-* attributes in HTML5?


Custom data attributes to store extra info, e.g., <div data-id="123">

What is contenteditable?
Makes an element editable by the user, e.g., <div contenteditable="true">Edit me</div>

How can you make a page responsive?


Use <meta name="viewport" content="width=device-width, initial-scale=1.0">

What is the difference between <script>, <noscript>, and <style>?


<script> adds JS, <noscript> shows content if JS is disabled, <style> adds CSS.

How do you include a favicon?


<link rel="icon" href="favicon.png" type="image/png">

What is accessibility in HTML?


Ensuring content is usable by people with disabilities using alt text, ARIA roles, and proper
structure.

You might also like