Unit-3 Questions
Unit-3 Questions
Unit-3 Questions
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>