0% found this document useful (0 votes)
25 views4 pages

Chapter 4 Notes

Hi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views4 pages

Chapter 4 Notes

Hi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Click Here To Go On Full Playlist | Click Here To Download App

Chapter 4
Images, Links and Tables

 Insert images: img (attributes: src, width, height, alt)


 Embed audio and video in a HTML page.
 Links: significance of linking, anchor element (attributes: href, mailto), target.
 Create a table using the tags: table, tr, th, td, rowspan, colspan, cellpadding, cellspacing.

Q1: What is <img> tag? / How <img> tag works? And discuss its attributes also.
Ans: <Img>: Img tag is used to insert image.
Example: <img src=”image.jpg” alt=”This is image” align=”right width=”200px” border=5>

Some <img> tag Attribute:

1. Src: This attribute is used to give path of image. (Absolute or Relative)


2. Width and Height: These attribute is used to set imagedimension.

3. Alt: This attribute used to provide alternate text for an image.


4. Align: This attribute is used to align the images in webpage, Example: top, middle, bottom, left,
right and center.
5. Border: The border attribute of the <img> tag specifies the width of the border around an
images. By default , an image has no border in HTML.
Q2: What is Linking or Hyperlink? / How <a> tag works? /Discuss its attributes And Type of linking.
Ans: Hyperlink: It is a link between Web pages. When a user clicks a hyperlink on a Webpage, he or
she is redirected either to some other section of the same web page or another webpage.
<a href=”home.html” title=”This is home page”>
Some <a> tag Attribute:
1. Href: The href attribute specifies the URL of the destination web page.
2. Title: This attribute is used to specify title to the destination web page. The text appears when
a user mouse over on that link, that text is also called Tool Tip.
3. Name: This attribute is use to create internal linking in html document,
Example: <a name=”bottom”>Go to bottom </a>
4. Target: The target attribute specifies where to open the linked document.
target=_slef : Opens the linked document in the same frame as it was clicked (this is default).
target=_blank : Opens the linked document in a new window or tab.
Example: <a href=”home.html” target=_blank>
Types of Linking:
External Linking Internal linking
1) On clicking external link we used to 1) On clicking internal link we used to
Redirect to other webpage or document. Redirect to other section of same webpage.
2)Ex:- 2)Ex:-
<a href=”about.html”>About</a> <a name=”bottom”>This is bottom </a>
<a href=”#bottom”>Go to bottom </a>
<a href=”next.html#bottom”> Go to bottom </a>
Q3: How to create an e-mail link? Or What is Mailto function in <a> tag?
Ans: Mailto function is used to create a link that allows the user to write and send an email to
specified address.
Example: <a href=mailto:[email protected]> Click here</a>

Q4: How to import audio and video in any html web page?
Ans: Import Audio:
<audio>: audio tag is used to import audio.
Example: <audio src=”audio.mp3” controls autoplay loop></audio>

<audio> tag attribute:

1. Src: This attribute use to specifies URL or Location or audio/video file.

2. Controls: This attribute used to provide controls on video/audio player.Ex:


Play, pause and volume control

3. Autoplay: Plays the video/audio file as the webpage is loaded.


4. Loop: Replays the video/audio file.
Import Video:
<video>: video tag is used to import video.
Example: <video src=”video.mp4” controls autoplay loop></video>

<video> tag attribute:

1. Src: This attribute use to specifies URL or Location or audio/Video file.

2. Controls: This attribute used to provide controls on video/audio player.Ex:


Play, pause and volume control

3. Autoplay: Plays the video/audio file as the webpage is loaded.


4. Loop: Replays the video/audio file.
5. Height and Width: To control Height and Width of video.

Q5: What is Table in html? And How to create Table in html?


Ans: Table arrange data in rows and columns and provide an attractive ways to represent information.

Tags: <table>,<caption> <tr> table row, <td> Table data, <th> table head.
Attribute: border, bgcolor, bordercolor, cellspacing, cellpadding, rowspan, colspan,valign.

Border: Border attribute is used to set border around the table.


Bordercolor: This attribute is used to set the color on table’s border.
Bgcolor: This attribute is used to set background color on table.

Difference between Cellspacing and Cellpadding


CELLSPACING CELLPADDING
1) The CELLSPACING attribute is used to 1) The CELLPADDING attribute is used to
specify the space between the borders of specify the space between the edges of a
a cell. cell and its content.

2) Ex:- <table cellspacing=”10px”> 2) Ex:- <table cellpadding=”10px”>

Difference between Rowspan and Colspan

ROWSPAN COLSPAN
1) It is used to make a cell by merging two 1) It is used to make a cell by merging
or more rows of table. two or more columns of a table.
2) ROWSPAN attribute merge cells 2) COLSPAN attribute merge cells
vertically. horizontally.
3) Ex:- <td rowspan=”2”>text</td> 3) Ex:- <td colspan=”2”>text</td>
Valign: This attribute is used in <TD> tag to set the vertical alignment of the particular cell’s content.
Its values are:
 Top: It is used to put the text as close to the top of the cell as it is possible.
 Middle: This is used to put text in middle of the cell.
 Bottom: It is used to put the text as close to the bottom of the cell as it is possible.

Q6: What is <THEAD>, <TBODY> and <TFOOT> tag in HTML?


Ans: These tags are used to divide table into three portions as head, body, and foot.
<THEAD>: This indicates that a group of rows as the header rows at the top of the table.
<TBODY>: This indicates that a group of rows as body or main part of the table.
<TFOOT>: This indicates that a group of rows as the footer rows at the bottom of the table.

You might also like