Unit-3 - PDF For CC
Unit-3 - PDF For CC
Unit-3 - PDF For CC
<head>
<title>Using Image in Webpage</title>
</head>
<body>
<p>Simple Image Insert</p>
<img src = "/html/images/test.png" alt = "Test Image" />
</body>
</html>
<head>
<title>Set Image Width and Height</title>
</head>
<body>
<p>Setting image width and height</p>
<img src = "/html/images/test.png" alt = "Test Image" width = "150" height =
"100"/>
</body>
</html>
Example :
<head>
<title>Left Alignment of Image</title>
</head>
<body>
<h1>SVP</h1>
<h3>Welcome to S.V. Patel College</h3>
<h4>Left Alignment of Image</h4>
<!-- Keep align attribute value as left -->
<img align="left" src="logo3.png" alt="hello">
</body>
</html>
Creating tables and table structure, table header, table rows and table
cell.
HTML tables: - It allows web developers to arrange data into rows and columns.
A table in HTML consists of table cells inside rows and columns.
<table>…</table> is used to create a table in HTML.
<tr>….</tr> is uder to create table rows
<th>----</th> is uded to create table header(column).
<td>….</td> is used to create table data(column).
</tr>
<tr>
<td>……..</td>
<td>……..</td>
<td>……..</td>
</tr>
</table>
Example:
<html>
<head>
<title>HTML Table</title>
</head>
<Body>
<table style="width:100%">
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
<tr>
<td>Alfreds Futterkiste</td>
<td>Maria Anders</td>
<td>Germany</td>
</tr>
<tr>
<td>Centro comercial Moctezuma</td>
<td>Francisco Chang</td>
<td>Mexico</td>
</tr>
</table>
</body>
</html>
Output:
</tr>
<tr>
<th>Lastname</th>
<td>Smith</td>
<td>Jackson</td>
</tr>
<tr>
<th>Age</th>
<td>94</td>
<td>50</td>
</tr>
</table>
<body>
<table border="2" width="50%">
<tr>
<th align="left">Firstname</th>
<td >Jill</td>
<td>Eve</td>
</tr>
<tr>
<th align="left">Lastname</th>
<td>Smith</td>
<td>Jackson</td>
</tr>
<tr>
<th align="left">Age</th>
<td>94</td>
<td>50</td>
</tr>
</table>
</body>
</html>
Table Caption
You can add a caption that serves as a heading for the entire table.
Monthly savings
Month Savings
January $100
February $50
To add a caption to a table, use the <caption> tag:
<table style="width:100%">
<caption>Monthly_savings</caption>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$50</td>
</tr>
</table>
Cell padding:
Cell padding specifies the space between the border of a table cell and its
contents (i.e) it defines the whitespace between the cell edge and the content of
the cell.
Syntax:
<table cellpadding="value" >.....</table>
where, value determines the padding
(space between the border of a table and its content)
Cell Spacing:
Cell spacing specifies the space between cells (i.e) it defines the whitespace
between the edges of the adjacent cells.
Syntax:
<table cell spacing="value" >.....</table>
where, value determines the padding
(space between adjacent cells)
Example:
<html>
<head> <title> Formatting table </title></head>
<body>
<table border="1"
cell padding="4"
cell spacing="5">
<tr>
<th>Name</span></th>
<th>Age</th>
</tr>
<tr>
<td>Rani</td>
<td>30</td>
</tr>
<tr>
<td>Rajan</td>
<td>35</td>
</tr>
<tr>
<td>Akshaya</td>
<td>17</td>
</tr>
<tr>
<td>Ashick</td>
<td>13</td>
</tr>
</table>
</body>
</html>
2. Merging cells: colspan and rowspan: The rowspan and colspan are the
attributes of <td> tag. These are used to specify the number of rows or
columns a cell should merge. The rowspan attribute is for merging rows and
the colspan attribute is for merging columns of the table in HTML.
Example of colspan:
<!DOCTYPE html>
<html>
<head>
<title> Colspan </title>
</head>
<body>
Eve Jackson 57
Example of rowspan:
<!DOCTYPE html>
<html>
<head>
<title> Rowspan </title>
</head>
<body>
<h2>Cell that spans two rows</h2>
<p>To make a cell span more than one row, use the rowspan attribute.</p>
<table width="100%">
<tr>
<th>Name</th>
<td>Jill</td>
</tr>
<tr>
<th rowspan="2">Phone</th>
<td>555-1234</td>
</tr>
<tr>
<td>555-8745</td>
</tr>
</table>
</body>
</html>
Output:
To make a cell span more than one row, use the rowspan attribute.
Name Jill
555-1234
Phone
555-8745
To embed audio in HTML, we use the <audio> tag. Before HTML5, audio cannot
be added to web pages in the Internet Explorer era. To play audio, we used web
plugins like Flash. After the release of HTML5, it is possible. This tag supports
Chrome, Firefox, Safari, Opera, and Edge in three audio formats – MP3, WAV,
OGG. Only Safari browser doesn’t support OGG audio format.
The HTML5 <audio> and <video> tags make it simple to add media to a website.
You need to set src attribute to identify the media source and include a controls
attribute so the user can play and pause the media.
Note: Before adding an audio source must be sure that the audio file is in the
same directory and specified name.
Syntax:
<audio>
<source src="file_name" type="audio_file_type">
</audio>
auto
It specifies how the author thinks the audio will be
preload metadata
loaded when the page is ready.
none
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h2>Click play button to play audio</h2>
<audio src="./test.mp3" controls></audio>
</body>
</html>
You can use <source> tag to specify media along with media type and many other
attributes. A video element allows multiple source elements and browser will use
the first recognized format
<!DOCTYPE HTML>
<html>
<body>
</body>
</html>
controls controls It displays video control such as play, pause, and stop.
auto
It specifies how the author thinks the video will be loaded
preload metadata
when the page is ready.
none
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h2>Click play button to play video</h2>
<video src="./test.mp4" controls></video>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h2>Click play button to play video</h2>
<video controls>
<source src="./test.mp4">
</video>
</body>
</html>
2
00:00:15.000 --> 00:00:18.000
one man is about to do the impossible.
Pro tip: While you can create a WebVTT caption file yourself, or convert an
existing caption file, the easiest way is to submit your video for transcription and
captioning to a professional captioning company.
2. Upload Caption File to the Same Folder as Your Video
When your website plays a video, it references a specific video file that is stored
on your website’s server. Save a copy of your WebVTT caption file in the same
folder where your video is stored.
3. Add a Track Element to Your Video's HTML Code
Open up your website’s HTML editor and view the code for the video that needs
captions.
Add a track tag with the following information:
src – the URL location of the caption file on your server
</video>
<!DOCTYPE HTML>
<html>
<body>
</body>
</html>