HTML - Adding multimedia elements and Forms
Chapter 12 · Tamil Nadu State Board
- 9 min read
- 6-question quiz
Every key point below shows the sentence from your textbook it comes from. Book back answers are solved and checked against the book; answers we could not prove are left out. How we check content
In short
This lesson teaches how to add images, scrolling content, audio and video to HTML pages. It explains how form tags and controls collect information from users and send it to a server. Choosing suitable tags and attributes helps create web pages that communicate clearly and gather the information they need.
Written by AI from this lesson. How we check it
Key points
- The <img> tag uses src to identify the image file or its location.
From your textbook
“The <IMG> tag along with the attribute src (Source) is used to add images in HTML document.”
- The alt attribute supplies a description when an image cannot be displayed.
From your textbook
“The alt attribute within <img> tag is used to describe the image, so that some text is conveyed even when the image cannot be displayed.”
- The <marquee> tag moves text or images horizontally or vertically.
From your textbook
“a piece of text or image can be moved horizontally or vertically by using <marquee> tag.”
- The <embed> tag attaches audio or video within a web page.
From your textbook
“The <embed> tag is used to attach an audio or video file easily within webpage.”
- Forms collect user information, and their controls include text boxes, radio buttons and check boxes.
From your textbook
“Forms are used to receive information from the user.”
- The get method adds form names and values to the URL, while post sends them as packets.
From your textbook
“The get method will append the names of the form elements and their values to the URL. The post method will send the names and values of the form elements as packets.”
- A <select> tag makes a dropdown list, and <option> tags define its choices.
From your textbook
“The <option> tag is used to specify list items.”
Formulas in this chapter
- Image tag format<img src = image_name_with_extension>Explained here
- Marquee format<marquee> Text or image to be scroll </marquee>Explained here
- General format for <embed><embed src = audio / video file name with location> </embed>Explained here
- General format for background sound<bgsound src=music file name with location>Explained here
- General format of the <form> tag<Form method=get/post action= “back_end_server_script”> Form elements </Form>Explained here
Image Formats for Web Pages
Images can make web pages more attractive and help explain complex ideas simply. Use an image format supported by browsers. Image editing applications can convert an image from one format to another.
Common image formats
| Format | Best use or feature |
|---|---|
| GIF (Graphical Interchange Format) | Suitable for tiny animations, logos, icons and line art. It uses a maximum of 256 colours and is not suitable for photographs. Animated GIF do not support sound |
| JPEG (Joint Photographic Experts Group) | Suitable for photographic images. It can include any number of colours and is supported by all web browsers. |
| PNG (Portable Network Graphics) | Designed as a replacement for GIF. It is supported by all browsers. |
| SVG (Scalable Vector Graphics) | A graphics format developed for the web. It was standardized by World Wide Web Consortium (W3C) in 2001. Current web browsers support its basic features. |
Adding Images with the img Tag
Use the <img> tag to place an image in an HTML document. Its src attribute gives the image file name or URL. If the image is outside the current working folder, give its path or URL.
<img src = image_name_with_extension>
src specifies the image file name or URL.
Useful img attributes
- alt gives text describing the image. This text can be shown when the image cannot be displayed.
- Width and Height set the image dimensions. Values can be in pixels or as a percentage of the actual size. Without them, the image appears in its original size.
- Vspace and Hspace set vertical and horizontal space around images.
- align positions the image in relation to the text baseline. Bottom is the default; Middle and Top align the image's middle or top with the baseline. Left and Right place the image on the corresponding side of the text.
Remember: The src attribute identifies which image file or URL the browser should use.
Scrolling Text and Images with marquee
Definition
- <marquee>
- An HTML tag that moves text or an image horizontally or vertically on a web page.
<marquee> Text or image to be scroll </marquee>
The content placed between the tags is moved across the page.
Marquee attributes
- Height and Width set the marquee size in pixels or as a percentage of the browser window.
- Direction sets the movement direction. The default is left, from right to left. Possible values are ‘up’, ‘down’, ‘left’ or ‘right’.
- Behaviour selects the scrolling type: ‘scroll’, ‘slide’ or ‘alternate’.
- Scrolldelay sets the time delay between each jump. Its time unit is seconds.
- Scrollamount sets the scrolling speed.
- Loop sets how many times the marquee repeats. Its default value is ‘infinite’, so it scrolls endlessly.
- Bgcolor sets the marquee background colour.
- Hspace and Vspace set horizontal and vertical space around the marquee, in pixels or as a percentage.
Remember: A marquee moves its content; its direction is left by default.
Adding video and audio with the embed tag
HTML can include audio and video as inline media or link to external media files. Inline media is handled as part of the page and can play while the page is visible in a browser. External media is linked using a URL.
Definition
- <embed>
- This tag attaches an audio or video file to a webpage and lets the browser display multimedia controls.
The src attribute gives the media file name and its location. Attributes such as alt, height, width and align can also be used. The <noembed> tag can provide another media file if a browser does not support <embed>.
<embed src = audio / video file name with location> </embed>
src specifies the audio or video file and its location.
Remember: Use <embed> to attach a media file; use src to identify where that file is located.
Playing background music
The <bgsound> tag attaches inline sound so it can play while a webpage is being viewed. Its src attribute gives the sound file location. The volume attribute adjusts the volume, while loop defines how long the sound plays.
Definition
- loop=infinite
- This setting causes the audio to play as long as the page is in view.
<bgsound src=music file name with location>
src specifies the music file and its location.
Remember: For inline background sound, remember the <bgsound> tag and its src attribute.
HTML forms and their method and action attributes
Forms collect information from users. They can be used for registration, login, orders, feedback and search keywords. A form begins with <form> and ends with </form>.
Common form elements
- Text boxes
- Radio buttons
- Check boxes
- Buttons
- Drop-down lists
Each form element gets a name through the name attribute. Users enter or select values, which are sent to the server with the corresponding element names. A submit button sends the form entries to a server application for processing.
Form methods
| get | post |
|---|---|
| Appends form element names and values to the URL. | Sends form element names and values as packets. |
Definition
- action
- The action attribute identifies the server-side program or script that processes the form.
<Form method=get/post action= “back_end_server_script”> Form elements </Form>
method selects how names and values are sent; action identifies the program that processes the form.
Remember: method controls how form data is sent, and action identifies what processes it.
Input controls and their attributes
Definition
- <input>
- This empty tag creates form controls such as text boxes and radio buttons.
Values of the type attribute
| Type value | Purpose |
|---|---|
| Text | Creates a text box for text such as a name or address. |
| Password | Creates a text box that displays entered characters as coded symbols such as asterisk. |
| Checkbox | Creates a small square that can be selected; it allows multiple options to be chosen. |
| Radio Button | Creates a small circle for choosing one option from a group. Choosing another option deselects the previous one. |
| Reset | Clears entries made in the form. |
| Submit | Sends form entries to the backend server. |
| Button | Creates a standard graphical button used to call functions when clicked. |
Other <input> attributes
- Name assigns a name to the input control. Its data value is sent with this name when the form is submitted.
- Value sets a default value for some controls.
- Size sets the width of text and password boxes in characters.
- Maxlength sets the number of characters that can be entered in text and password boxes.
A login form can use text and password controls, along with reset and submit buttons. A form can also use radio buttons for one choice and check boxes for multiple choices.
Remember: Radio buttons allow one choice from a group; check boxes allow multiple choices.
HTML Forms and Input Controls
Definition
- Form
- A form is an HTML section used to receive information from the user.
An HTML form begins with <form> and ends with </form>. The <input> tag creates many form controls. Forms can include text fields, radio buttons, checkboxes, dropdown lists, text areas, and Clear and Submit buttons.
Controls shown in a student data entry form
- Text fields for Student Name and Email
- Radio buttons for choosing Boy or Girl
- Checkboxes for selecting Subjects
- A dropdown list for City / Town
- A text area for Comments
- Clear and Submit buttons
Remember: Forms collect information from users, and most form controls are created with the <input> tag.
Dropdown Lists with <select> and <option>
The <select> tag creates a dropdown list box. It is useful when many choices must fit in a limited space. The <option> tag adds each choice to the list.
Attributes of <select> and <option>
| Tag and attribute | Purpose |
|---|---|
| <select> name | Gives the control a name that is sent to the server. |
| <select> size | Sets the display style: Size = 1 gives a dropdown list box; Size = 2 gives a List box. |
| <select> multiple | Allows the user to select multiple values. |
| <option> selected | Indicates the default selection. |
| <option> value | Sets the value submitted to the server. |
In the City / Town example, Madurai is the default choice because its option uses selected. The other choices are Chennai, Coimbatore, and Kanyakumari.
Remember: Use <select> to create the list and <option> to specify its items.
Multiline Input with <Textarea>
Definition
- <Textarea>
- The <Textarea> tag creates a control for entering text on multiple lines.
<Textarea> is a container tag. Its name attribute identifies the control. The rows attribute sets the number of rows, while cols sets the number of columns, or characters in a line.
Main <Textarea> attributes
- Name: defines the control's name.
- Rows: specifies the number of rows.
- Cols: specifies the number of columns, meaning the number of characters in a line.
Remember: Use <Textarea> when the user needs to enter multiline text, such as comments.
Questions students ask
Short, direct answers to what students search for in this chapter.
How do I add an image in HTML?
Use the <img> tag with the src attribute. For example, <img src = image1.gif> displays the image file named image1.gif. If the image is not in the current working folder, specify its file path or URL in src.
What is the alt attribute in an HTML image tag?
The alt attribute describes an image. Its text can still convey information when the image cannot be displayed. For example, alt = “National Poet of India” provides a description for an image.
What are the differences between GIF and JPEG images?
GIF is suitable for tiny animations, logos, icons and line art. It uses a maximum of 256 colours, so it is not suitable for photographs. JPEG is suitable for photographic images and can include any number of colours.
How do I change the direction of a marquee in HTML?
Set the direction attribute in the <marquee> tag. Possible values are ‘up’, ‘down’, ‘left’ or ‘right’. The default direction is left, so the text or image moves from right to left.
What is the difference between inline and external audio or video in HTML?
Inline audio or video is handled as part of the webpage and can play while the page is visible in the browser. External audio or video is linked as a URL. The <embed> tag can attach a media file to a webpage.
What does the src attribute do in the <embed> tag?
The src attribute specifies the name of the audio or video file and its source location. The <embed> tag uses it to attach the media file to the webpage. Other attributes, such as height and width, can also be used.
Show 8 more questions
What is the use of the <bgsound> tag in HTML?
The <bgsound> tag attaches an inline sound file to a webpage so it can play while the page is being viewed. Its src attribute gives the file location. The loop attribute controls the duration, and loop=infinite keeps audio playing while the page is in view.
What is the difference between get and post methods in an HTML form?
The get method appends the names of form elements and their values to the URL. The post method sends the names and values as packets. The method attribute identifies how form data will be sent to the server.
What is the difference between radio buttons and check boxes in HTML forms?
Radio buttons let a user select only one option from a group. Selecting another option deselects the previous one. Check boxes allow the user to select multiple options. Both are form controls created using the <input> tag.
What is the <select> tag used for in HTML?
The <select> tag creates a dropdown list box in an HTML form. It displays choices in a limited space. Each choice is added with an <option> tag, and attributes can set the control's name, display style, multiple selection, default choice, and submitted value.
What do the name, size, and multiple attributes do in a <select> tag?
The name attribute gives the control a name that is sent to the server. The size attribute sets its display style: Size = 1 gives a dropdown list box, and Size = 2 gives a List box. The multiple attribute allows the user to select multiple values.
What is the purpose of the selected attribute in an <option> tag?
The selected attribute indicates which option is the default selection in a dropdown list. In the City / Town example, Madurai is selected by default. The option's value attribute sets the value that is submitted to the server.
What is the <Textarea> tag used for in HTML?
The <Textarea> tag creates a form control for entering multiline text. It is a container tag. Its name attribute identifies the control, rows sets the number of rows, and cols sets the number of columns, or characters in a line.
What controls can an HTML student data entry form contain?
A student data entry form can contain text fields for Student Name and Email, radio buttons for Gender, checkboxes for Subjects, a City / Town dropdown list, a Comments text area, and Clear and Submit buttons. These controls let users enter or choose information.
Book back answers
18 textbook exercises, solved and checked against the book. Questions we could not prove are left out.
Part – I — Choose the correct answer
Which image format was standardize by W3C?
- (A) JPEG
- (B) SVG
- (C) GIF
- ( D ) PNG
Try it, then show the answerAnswer
(B) SVG
SVG was standardized by the World Wide Web Consortium (W3C) in 2001.
From the book: “It was standardized by World Wide Web Consortium (W3C) in 2001.”
The tag used to insert an image in HTML:
- (A) Image
- (B) Picture
- (C) Img
- (D) Pic
Try it, then show the answerAnswer
(C) Img
The <IMG> tag, together with the src attribute, is used to add images to an HTML document.
From the book: “The <IMG> tag along with the attribute src (Source) is used to add images in HTML document.”
In HTML, a piece of text or image can be moved horizontally or vertically by using:
- (A) <marquee>
- (B) <img>
- (C) <embed>
- (D) <text>
Try it, then show the answerAnswer
(A) <marquee>
The <marquee> tag moves text or images horizontally or vertically.
From the book: “a piece of text or image can be moved horizontally or vertically by using <marquee> tag.”
Inline sound can be inserted using which of the following tag?
- (A) <inline>
- (B) <backgroundsound>
- (C) <bgsound>
- (D) <sound>
Try it, then show the answerAnswer
(C) <bgsound>
The chapter identifies <bgsound> as the tag for attaching an inline sound file.
From the book: “The <bgsound> tag is used to attach an inline sound file in HTML.”
Practice
Which attribute identifies the image file to display?
Exam questions
Practice questions with model answers. These are not from an official paper.
Explain the purpose of the src and alt attributes in an <img> tag.2 marks
The src attribute specifies the image file name and its location. The alt attribute describes the image so that text is conveyed if the image cannot be displayed.
How do the get and post methods send form data?2 marks
The get method appends form element names and values to the URL. The post method sends the names and values as packets.
Distinguish between a checkbox and a radio button.2 marks
A checkbox lets the user select multiple options. A radio button lets the user choose one option from a group; choosing another option deselects the earlier one.
Describe the purpose of the <select>, <option> and <textarea> tags.2 marks
The <select> tag creates a dropdown list, and <option> specifies its list items. The <textarea> tag receives multiline text input.
Watch out
- Do not confuse checkboxes with radio buttons: checkboxes allow multiple choices, while radio buttons allow one choice from a group.
- Do not confuse the form attributes: method determines how data is sent, while action identifies the program that processes it.
Still stuck on this lesson?
Get an AI answer grounded in your actual textbook — with the exact page reference.
Ask AI about this topic →