Wweb Page HTML Questions
Wweb Page HTML Questions
a) <link>
b) <a>
c) <h1>
d) <p>
Answer: b) <a>
3- Which HTML element is used to define the structure of an HTML document, including headings,
paragraphs, and lists?
a) <section>
b) <body>
c) <header>
d) <article>
Answer: b) <body>
a) <ol>
b) <ul>
c) <li>
d) <dl>
Answer: a) <ol>
5- What does the HTML <img> tag do?
6- Which HTML tag is used to define the header for a section or article?
a) <header>
b) <title>
c) <head>
d) <h1>
Answer: d) <h1>
b) To create a hyperlink
a) <br>
b) <p>
c) <lb>
d) <hr>
Answer: a) <br>
9- What is the correct way to comment out HTML code?
b) /* This is a comment /
c) // This is a comment
d) / This is a comment */
a) <ol>
b) <ul>
c) <li>
d) <dl>
Answer: b) <ul>
a) A section of text
12- Which HTML tag is used to create a hyperlink that opens in a new browser window or tab?
a) <link>
b) <a>
c) <target>
d) <new>
Answer: b) <a>
13- Which HTML element is used to define a division or a section within an HTML document?
a) <section>
b) <div>
c) <article>
d) <span>
Answer: b) <div>
d) To define a hyperlink
15- Which HTML attribute is used to specify the source URL of an image?
a) src
b) href
c) link
d) imgsrc
Answer: a) src
b) To specify metadata about the document, such as the title and character encoding
d) To define a hyperlink
Answer: b) To specify metadata about the document, such as the title and character encoding
17- Which HTML tag is used to create a clickable button?
a) <button>
b) <input>
c) <label>
d) <select>
Answer: a) <button>
a) Ordered List
b) Open Link
c) Object List
d) Ordered Link
19- Which HTML element is used to define the footer for a section or article?
a) <footer>
b) <bottom>
c) <end>
d) <tail>
Answer: a) <footer>
d) To create a hyperlink
a) <link>
b) <mailto>
c) <a>
d) <email>
Answer: b) <mailto>
a) Defines a hyperlink
a) <abbr>
b) <acro>
c) <abbrv>
d) <abbrvtn>
Answer: a) <abbr>
c) To display a video
d) To define a footer
a) <audio>
b) <sound>
c) <music>
d) <play>
Answer: a) <audio>
b) To create a hyperlink
c) To define a table
d) To format text
a) <bold>
b) <i>
c) <em>
d) <u>
Answer: b) <i>
a) alt
b) src
c) title
d) desc
Answer: a) alt
Answer: b) Embeds a video player in the web page to play video content
a) <input>
b) <select>
c) <dropdown>
d) <menu>
Answer: b) <select>
a) To create a button
b) To define a header
a) max
b) length
c) maxlength
d) limit
Answer: c) maxlength
a) To display a video
b) To create a hyperlink
c) To define a footer
35- Which HTML element is used to create a list of terms and their definitions?
a) <list>
b) <table>
c) <dl>
d) <deflist>
Answer: c) <dl>
a) Creates a hyperlink
a) <sup>
b) <sub>
c) <italic>
d) <small>
Answer: b) <sub>
d) To create a hyperlink
39- Which HTML attribute is used to specify the alignment of text within a table cell?
a) valign
b) align
c) text-align
d) td-align
Answer: b) align
Answer: c) To define additional content that is tangentially related to the main content
41- Which HTML element is used to define a container for navigation links in a web page?
a) <nav>
b) <header>
c) <menu>
d) <footer>
Answer: a) <nav>
43- Which HTML element is used to create a horizontal rule or thematic break?
a) <hr>
b) <br>
c) <line>
d) <rule>
Answer: a) <hr>
d) To define a hyperlink
Answer: b) To display a progress bar for tasks that take time to complete
45- Which HTML attribute is used to specify the default value for an input field?
a) value
b) default
c) initial
d) placeholder
Answer: a) value
a) To create a hyperlink
b) To define a table
a) <ul>
b) <ol>
c) <li>
d) <dl>
Answer: b) <ol>
c) Defines a button
d) Creates a hyperlink
a) <strong>
b) <highlight>
c) <em>
d) <italic>
Answer: c) <em>
b) To represent the base text of a ruby annotation, which is used for pronunciation guides in East Asian
typography
c) To create a hyperlink
Answer: b) To represent the base text of a ruby annotation, which is used for pronunciation guides in
East Asian typography
51- What is the role of the HTML <tfoot> element within a table?
52- Which HTML element is used to define the main content of a web page?
a) <content>
b) <main>
c) <body>
d) <section>
Answer: b) <main>
53- Which HTML element is used to define an embedded content, such as a YouTube video?
a) <embed>
b) <iframe>
c) <object>
d) <video>
Answer: b) <iframe>
54- What is the purpose of the HTML <summary> element within a <details> element?
b) To create a hyperlink
b) To create a hyperlink
56- Which HTML attribute is used to specify the type of input in a form element?
a) type
b) input-type
c) form-type
d) control-type
Answer: a) type
57- What is the purpose of the HTML <s> element?
a) To create a hyperlink
59- Which HTML attribute is used to specify the width of an element in pixels?
a) size
b) width
c) px
d) length
Answer: b) width
b) To create a hyperlink
a) <head>
b) <header>
c) <title>
d) <meta>
Answer: a) <head>
b) To define a header
c) To create a hyperlink
c) To create a hyperlink
a) To create a hyperlink
d) To create a hyperlink
b) Defines a hyperlink
68- Which HTML element is used to define the title of a web page?
a) <title>
b) <head>
c) <meta>
d) <h1>
Answer: a) <title>
69- What does the HTML <input> element do?
a) Defines a table
c) Creates a hyperlink
71- Which HTML element is used to define the structure of a web page's header, such as a logo and
navigation links?
a) <header>
b) <main>
c) <section>
d) <nav>
Answer: a) <header>
72- Which HTML element is used to define a container for the main content of a web page?
a) <content>
b) <main>
c) <body>
d) <article>
Answer: b) <main>
73- What does the HTML <hr> element create?
a) A hyperlink
c) A navigation menu
d) A numbered list
74- Which HTML attribute is used to specify the character encoding for the document?
a) charset
b) encoding
c) charcode
d) document-encoding
Answer: a) charset
Answer:
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>
Answer:
You can create a hyperlink in HTML using the <a> (anchor) element.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<header>
<h1>Welcome to My Website</h1>
<nav>
<ul>
</ul>
</nav>
</header>
<main>
<section id="section1">
<h2>Section 1</h2>
</section>
<section id="section2">
<h2>Section 2</h2>
</section>
<section id="section3">
<h2>Section 3</h2>
</section>
</main>
<footer>
</footer>
</body>
</html>
Answer:
77- <!DOCTYPE html>: Declares the document type and version (HTML5).
78- <html>: The root element that contains all other HTML elements.
79- <head>: Contains metadata about the document, such as character encoding and the page title.
85- <ul> and <li>: Create an unordered list for navigation links.
Answer:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<h1>Employee Information</h1>
<table border="1">
<tr>
<th>ID</th>
<th>Name</th>
<th>Position</th>
</tr>
<tr>
<td>1</td>
<td>John Doe</td>
<td>Manager</td>
</tr>
<tr>
<td>2</td>
<td>Jane Smith</td>
<td>Developer</td>
</tr>
<tr>
<td>3</td>
<td>Bob Johnson</td>
<td>Designer</td>
</tr>
</table>
</body>
</html>
Answer:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
body {
margin: 40px;
header {
text-align: center;
background-color: #333;
color: #fff;
padding: 10px;
main {
padding: 20px;
footer {
text-align: center;
background-color: #333;
color: #fff;
padding: 10px;
</style>
</head>
<body>
<header>
</header>
<main>
<h2>About Me</h2>
<h2>My Hobbies</h2>
<ul>
<li>Coding</li>
<li>Reading</li>
<li>Hiking</li>
</ul>
</main>
</body>
</html>
91- create this table and change the background
Row 3 Cell 1
Answer:
<!DOCTYPE html>
<html>
<head>
<title>HTML Table Background</title>
</head>
<body>
<table border="1" bordercolor="green" bgcolor="yellow">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
<tr><td rowspan="2">Row 1 Cell 1</td><td>Row 1 Cell 2</td><td>Row 1 Cell 3</td></tr>
<tr><td>Row 2 Cell 2</td><td>Row 2 Cell 3</td></tr>
<tr><td colspan="3">Row 3 Cell 1</td></tr>
</table>
</body>
</html>
92- What is the default text color in HTML for most browsers?
Answer: The default text color in HTML for most browsers is usually black (#000000) on a white
background (#FFFFFF).
Answer: Colors can be specified in HTML and CSS using various methods, including color names
(e.g., "red"), hexadecimal color codes (e.g., "#FF0000" for red), RGB values (e.g., "rgb(255, 0, 0)"
for red), and HSL values (e.g., "hsl(0, 100%, 50%)" for red).
94- What is the purpose of the "background-color" property in CSS?
Answer: The "background-color" property in CSS is used to set the background color of an
element, such as a div or a webpage.
Answer: You can create a transparent background color in CSS using RGBA values, where the
"A" stands for alpha (e.g., "rgba(255, 0, 0, 0.5)" for semi-transparent red).
Answer: The "color" property in CSS is used to set the text color of an element.
97- What is the difference between hexadecimal and RGB color values?
Answer: Hexadecimal color values are expressed in a six-digit format like "#RRGGBB," where RR
represents the red component, GG represents green, and BB represents blue. RGB values are
expressed as "rgb(R, G, B)," where R, G, and B are integer values between 0 and 255 for each
color channel.
Answer: You can create a gradient background in CSS using the "linear-gradient" or "radial-
gradient" property, specifying the colors and direction of the gradient.
Answer: The "opacity" property in CSS is used to control the transparency of an element and its
content. It accepts values from 0 (fully transparent) to 1 (fully opaque).
100- How can you set text color for specific elements in HTML and CSS?
Answer: You can set text color for specific elements in HTML and CSS by targeting those
elements using selectors and applying the "color" property with the desired color value.