Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Unit-3 Questions

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Module-3:

Section 1: HTML Basics


1. Multiple Choice Question:
Which HTML tag is used to create a hyperlink?
a) <a>
b) <link>
c) <href>
d) <hyper>
2. Short Answer:
Explain the role of the <img> tag in HTML. Provide an example of how to insert an
image on a webpage using this tag.
3. Fill in the Blank:
The <table> tag in HTML is used to create __________ in a web page.
4. True/False:
The <frame> tag is used to divide the browser window into multiple sections where
each section can load a separate HTML document.
Section 2: Hyperlinks, URLs, and Text Formatting
1. Multiple Choice Question:
Which attribute is used within the <a> tag to specify the URL of the linked document?
a) src
b) href
c) link
d) id
2. Short Answer:
Differentiate between an absolute URL and a relative URL with examples.
3. True/False:
The <b> tag is used for bold text, while the <strong> tag provides semantic meaning
of importance in addition to bold formatting.
4. Essay:
Describe how to create an ordered and unordered list in HTML. Provide code
examples.
Section 3: Tables, Graphics, and Multimedia
1. Multiple Choice Question:
Which of the following attributes is NOT used in the <table> tag?
a) border
b) cellpadding
c) align
d) src
2. Short Answer:
Explain the use of the <audio> and <video> tags in HTML. Provide an example of
each.
3. Essay:
Write the HTML code to create a table with 3 rows and 2 columns, where the first row
acts as a table header.
Section 4: Imagemap, Frames, and Forms
1. Short Answer:
What is an imagemap? Describe the difference between client-side and server-side
imagemaps.
2. True/False:
The <iframe> tag is used to embed another HTML document within the current
document.
3. Essay:
Create an HTML form that includes text fields, radio buttons, checkboxes, and a
submit button. Write the code for the form.
Section 5: CSS in Web Pages
1. Multiple Choice Question:
What does CSS stand for?
a) Cascading Style Sheets
b) Creative Style Sheets
c) Computer Style Sheets
d) Compact Style Sheets
2. Short Answer:
Write the syntax for adding an internal CSS to a webpage. Explain how internal CSS
differs from external CSS.
3. Essay:
Explain the box model in CSS. How do margin, border, padding, and content relate to
the box model? Provide an example of how to use CSS to apply padding and margin
to an HTML element.
Section 6: Introduction to DHTML
1. Short Answer:
What is DHTML? How is it different from standard HTML?
2. Essay:
Discuss how JavaScript is used in combination with HTML and CSS to create
dynamic effects in DHTML. Provide an example of a simple JavaScript function that
changes the content of an HTML element.
Short Answer Type Questions
1. What is the purpose of the <a> tag in HTML?
The <a> tag is used to create hyperlinks in HTML, allowing users to navigate
between web pages or sections within the same page by specifying the href attribute,
which contains the URL of the destination.
2. What is an absolute URL and how does it differ from a relative URL?
An absolute URL contains the full path to a resource, including the protocol (e.g.,
https://example.com/page.html), while a relative URL defines the path relative to the
current document's location (e.g., /page.html).
3. What is the role of the <form> tag in HTML?
The <form> tag is used to create interactive forms in HTML, allowing users to input
data and submit it to a server for processing, typically via methods like GET or POST.
4. Explain the box model in CSS.
The CSS box model describes how an element's content is wrapped by padding,
borders, and margins. It consists of four components: content, padding, border, and
margin, each influencing the spacing and layout of an element.
5. What is an imagemap in HTML?
An imagemap is a graphical image with clickable areas (hotspots) that link to different
locations or perform actions. It can be client-side, where the hotspots are defined in
the HTML using coordinates, or server-side, where the server processes the map's
clickable areas.

Broad Answer Type Questions


1. Explain how tables are used in HTML for structuring data. Provide examples.
Tables in HTML are used to organize and display data in rows and columns. The
<table> tag creates the table, while <tr>, <th>, and <td> tags define rows, headers,
and cells respectively. Attributes like border, cellpadding, and cellspacing control the
table's appearance. For example:
html
Copy code
<table border="1">
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>Alice</td>
<td>30</td>
</tr>
<tr>
<td>Bob</td>
<td>25</td>
</tr>
</table>
This code creates a simple table with two rows of data.
2. Discuss the role of CSS in web page design and describe the three different ways
to apply CSS to HTML elements.
CSS (Cascading Style Sheets) is used to control the visual presentation of web pages
by defining styles such as colors, fonts, layout, and spacing. CSS separates the content
from its design, improving maintainability and consistency across web pages. There
are three ways to apply CSS:
o Inline CSS: Applied directly to HTML elements using the style attribute.

o Internal CSS: Placed within the <style> tag inside the <head> section of an
HTML document, applying styles to the entire page.
o External CSS: Defined in an external .css file and linked to the HTML
document via the <link> tag in the <head> section. This method allows for
reusability across multiple pages.
3. What are the advantages of using DHTML for web design, and how does it differ
from standard HTML?
DHTML (Dynamic HTML) allows for interactive and dynamic web pages by
combining HTML, CSS, and JavaScript. Unlike static HTML, where content is fixed,
DHTML enables changes to the structure, style, and content of a web page without
reloading it. With DHTML, elements can move, change colors, and respond to user
input in real-time, providing a richer user experience. Examples include animations,
form validation, and interactive navigation menus.
4. How are forms used to collect data in web pages? Write an HTML example with
different form controls.
Forms in HTML collect user input and send it to a server for processing. The <form>
element contains controls like text fields, checkboxes, radio buttons, and submit
buttons. Here's an example:
html
Copy code
<form action="/submit_form" method="POST">
<label for="name">Name:</label>
<input type="text" id="name" name="name">
<br>
<label for="email">Email:</label>
<input type="email" id="email" name="email">
<br>
<input type="checkbox" id="subscribe" name="subscribe" value="newsletter">
<label for="subscribe">Subscribe to newsletter</label>
<br>
<input type="radio" id="male" name="gender" value="male">
<label for="male">Male</label>
<input type="radio" id="female" name="gender" value="female">
<label for="female">Female</label>
<br>
<input type="submit" value="Submit">
</form>
This form collects a user's name, email, subscription preference, and gender.
5. Describe the role of multimedia (audio, video) in web design and explain how
HTML handles multimedia elements.
Multimedia elements such as audio and video enhance user engagement by offering
rich content beyond text and images. HTML provides the <audio> and <video> tags
to embed these types of media directly into web pages. Both tags support attributes
like controls for playback and autoplay for automatic playing when the page loads.
For example:
html
Copy code
<audio controls>
<source src="audiofile.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>

<video controls width="500">


<source src="videofile.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
These tags allow users to play audio and video without external plugins, improving
compatibility across browsers and devices.

You might also like