HTML Basics (1–20)
-
Q: What does HTML stand for?
A: HyperText Markup Language -
Q: What is the latest version of HTML?
A: HTML5 -
Q: What tag is used to create a hyperlink in HTML?
A:<a>
-
Q: Which tag is used to insert an image?
A:<img>
-
Q: What does the
<p>
tag define?
A: A paragraph -
Q: What is the root element of an HTML document?
A:<html>
-
Q: Which tag contains metadata for the HTML document?
A:<head>
-
Q: Which tag defines the title of the document?
A:<title>
-
Q: What is the correct tag to make text bold?
A:<b>
or<strong>
-
Q: What is the correct tag to make text italic?
A:<i>
or<em>
-
Q: What attribute is used to define inline styles?
A:style
-
Q: What attribute is used to define an image source?
A:src
-
Q: How do you write a comment in HTML?
A:<!-- Comment -->
-
Q: What tag is used to define a line break?
A:<br>
-
Q: What tag creates a horizontal line?
A:<hr>
-
Q: What tag is used for a list item?
A:<li>
-
Q: What are the two types of lists in HTML?
A: Ordered (<ol>
) and unordered (<ul>
) -
Q: How do you create a numbered list?
A: Using<ol>
-
Q: What tag defines the body of the HTML document?
A:<body>
-
Q: Which tag creates a table?
A:<table>
Attributes and Formatting (21–40)
-
Q: What tag defines a table row?
A:<tr>
-
Q: What tag defines a table cell?
A:<td>
-
Q: What is the tag for a table header cell?
A:<th>
-
Q: How do you set the background color of an element?
A: Usingstyle="background-color:color"
-
Q: What tag is used for headings?
A:<h1>
to<h6>
-
Q: Which is the largest heading tag?
A:<h1>
-
Q: Which is the smallest heading tag?
A:<h6>
-
Q: How do you create a checkbox in HTML?
A:<input type="checkbox">
-
Q: How do you create a radio button?
A:<input type="radio">
-
Q: Which tag is used for input fields?
A:<input>
-
Q: How do you create a text area?
A:<textarea>
-
Q: What tag is used to create a form?
A:<form>
-
Q: How do you submit a form?
A: Using<input type="submit">
-
Q: What does the
action
attribute in<form>
do?
A: Specifies where to send the form data -
Q: What does the
method
attribute in<form>
do?
A: Defines how to send form data (GET or POST) -
Q: What is a self-closing tag?
A: A tag that does not need a closing tag (e.g.,<br>
,<img>
) -
Q: How do you open a link in a new tab?
A: Addtarget="_blank"
to<a>
-
Q: What does the
alt
attribute in<img>
do?
A: Provides alternative text for the image -
Q: What tag defines a dropdown list?
A:<select>
-
Q: What tag defines an option in a dropdown list?
A:<option>
Forms and Inputs (41–60)
-
Q: What is the default method of a form?
A: GET -
Q: How do you create a password input field?
A:<input type="password">
-
Q: What is the use of the
<label>
tag?
A: Labels an input element -
Q: How do you group related inputs?
A: Using<fieldset>
-
Q: How do you define a caption for a
<fieldset>
?
A:<legend>
-
Q: How do you disable an input?
A: Adddisabled
attribute -
Q: How do you make an input required?
A: Addrequired
attribute -
Q: How do you create a submit button?
A:<button type="submit">
-
Q: What tag is used to embed external content?
A:<iframe>
-
Q: What is the use of the
placeholder
attribute?
A: Provides a hint in input fields -
Q: How do you set a maximum length for an input field?
A:maxlength="value"
-
Q: How do you pre-fill a value in a field?
A: Usingvalue="text"
-
Q: What is the use of
readonly
attribute?
A: Makes input non-editable but sendable -
Q: What is the use of the
<datalist>
tag?
A: Defines options for input suggestions -
Q: How do you create a file upload input?
A:<input type="file">
-
Q: What is the use of the
<button>
tag?
A: Creates a clickable button -
Q: How do you reset form inputs?
A:<input type="reset">
-
Q: What is the
name
attribute used for?
A: Identifies form input for backend -
Q: What tag adds inline quotations?
A:<q>
-
Q: What tag adds block quotations?
A:<blockquote>
HTML5 and Semantic Tags (61–80)
-
Q: What is a semantic tag?
A: A tag that clearly describes its meaning -
Q: What does
<article>
represent?
A: Self-contained content -
Q: What does
<section>
represent?
A: A section in a document -
Q: What does
<nav>
represent?
A: Navigation links -
Q: What does
<header>
represent?
A: A container for introductory content -
Q: What does
<footer>
represent?
A: Footer content -
Q: What does
<main>
represent?
A: Main content of the document -
Q: What does
<aside>
represent?
A: Side content or sidebar -
Q: What tag defines a figure with caption?
A:<figure>
and<figcaption>
-
Q: What tag is used for time-related content?
A:<time>
-
Q: What is the
<mark>
tag used for?
A: Highlighting text -
Q: What is the
<progress>
tag used for?
A: Displays a progress bar -
Q: What is the
<meter>
tag used for?
A: Displays a scalar measurement -
Q: What tag defines a dialog box?
A:<dialog>
-
Q: What is the
<summary>
tag used for?
A: Defines a summary for<details>
-
Q: What does
<details>
do?
A: Creates a collapsible element -
Q: Which tag is used to embed audio?
A:<audio>
-
Q: Which tag is used to embed video?
A:<video>
-
Q: What attribute makes media autoplay?
A:autoplay
-
Q: What is the
controls
attribute for?
A: Displays audio/video controls
Miscellaneous (81–100)
-
Q: Can HTML be used to
style content?
A: Only with inline styles (CSS is preferred)
-
Q: How do you comment in HTML?
A:<!-- comment -->
-
Q: Is HTML case-sensitive?
A: No, but lowercase is recommended -
Q: What tag is used to define keyboard input?
A:<kbd>
-
Q: What tag defines code snippets?
A:<code>
-
Q: What tag defines preformatted text?
A:<pre>
-
Q: What is a DOCTYPE?
A: Declares the HTML version -
Q: What is the correct HTML5 doctype?
A:<!DOCTYPE html>
-
Q: What is the use of
<span>
?
A: Applies style to inline content -
Q: What is the use of
<div>
?
A: Groups block-level elements -
Q: How do you link a CSS file to HTML?
A:<link rel="stylesheet" href="style.css">
-
Q: Can JavaScript be used in HTML?
A: Yes, using<script>
tag -
Q: What tag defines an abbreviation?
A:<abbr>
-
Q: How do you create a tooltip?
A: Use thetitle
attribute -
Q: What does
href
in<a>
stand for?
A: Hypertext REFerence -
Q: What does
<noscript>
do?
A: Displays content if JavaScript is disabled -
Q: What does
<base>
tag do?
A: Sets the base URL for all links -
Q: What is character encoding?
A: Defines how characters are stored -
Q: How do you specify character encoding in HTML5?
A:<meta charset="UTF-8">
-
Q: Can HTML work without CSS and JS?
A: Yes, but it will be plain and unstyled
No comments:
Post a Comment