Practical 3 - HTML Graphics, Audio, Video and Form
Practical 3 - HTML Graphics, Audio, Video and Form
Page 1 of 9
OBJECTIVES
REFERENCES
http://www.w3schools.com/html/
SUBMISSION
ACTIVITIES
Notes:
Create a folder Media in Week03 folder.
Download all the media files from Week03 Learning Material in BrightSpace
and save them in the Media folder.
Open index.html and form.html for editing in Visual Studio Code for Parts
A and B respectively.
Save the file and test your work using Firefox / Chrome after each step.
Page 2 of 9
Change the name of author to your name and the creation date to today.
Save the file and view the document in a browser. You should see an empty
web page with the title FC Practical 3A.
Page 3 of 9
Fig 1
(f) Add hyperlink to the car image:
Add the <a> and </a> tag around the <img> tag created in (e) above so
that the car image is hyperlinked to another website. Set href attribute to
specify the link to be http://www.cars.com and set target attribute to
_blank so that the page is opened in a new tab.
<a href="http://www.cars.com" target="_blank">
….
</a>
(g) Add a heading to the division:
Add a heading "Car" by using the h3 element. Set the color of the
element to darkblue by using the style attribute in the <h3> tag:
<h3 style="color:darkblue;">Car</h3>
(h) Add the description for the car image:
Enter the description shown in the box below in <p> tags:
Set the text color to blue by using the style attribute in the <p> tag:
<p style="color:blue;"> . . . . </p>
Page 4 of 9
Fig 2
Challenge:
Page 5 of 9
Your output shown in the browser should look like Fig 3 below:
Fig 3
[ Hint: use the style of “clear: right;” for the second <div> tag so that the
second division doesn’t overlap the first division ]
Add your choice of audio file to the web page using <audio> tag in a new
division with a h2 heading "Audio".
Add your choice of video to your web page using <video> tag in another
division with a h2 heading "Video".
Test your web page using different browsers such as Chrome and Firefox.
Your webpage should look as follows (the top part which is the same as Fig
3 above is truncated):
Page 6 of 9
Fig 4
Part B - HTML Form
Change the name of author to your name and the creation date to today.
2. Create a Form
We value your feedback. Please fill in the form below and click Submit
button.
Page 7 of 9
Page 8 of 9
Page 9 of 9
Challenge:
(d) Style your webpage:
(i) Set the style attribute for body element as follows:
font-family: Verdana, Geneva, Tahoma, sans-serif;
width:50%;
margin:auto;
(ii) Set the style attribute for form element as follows:
background-color: lightgray;
padding:10px;
(iii) Set the style attribute for label element as follows:
display: inline-block;
font-weight: bold;
width:100px;
View the form in the browser again to see the effect.