Professional Documents
Culture Documents
Lecture 3 - Presentation Design
Lecture 3 - Presentation Design
L
E
C
Presentation
T Design
U Graphics, Animated Images,
R Audio, Video, GUI, Form
E
Fundamentals of Computing
Polytechnic Foundation Programme
3 2022/23, Semester 2
Official (Closed) - Non Sensitive
Objectives
Topics
Use of Graphics
Background Images
Working with Graphics and Animated Images
Adding Audio and Video
Creating Forms
Use of Graphics
Graphics and images are a great way to liven up your
website.
• A picture is worth a thousand words.
Do not over use animations and images.
• They become irritating, distracting and slow to load.
• Sometimes, something simple is often more effective.
Background image of a page is set using "style" with the
background-image property for <body> tag.
Foreground (or inline) images which appear amongst text is
inserted using the <img> tag.
Background Image
By default, a background-image is placed at the top-left
corner, and repeated both vertically and horizontally (called
tiled).
Poor design!
Poor design!
• Use style attribute to set the float property to left or right to let the
image float to the left or to the right of a text:
<img style= "float:left;">
Add style=“clear:both” to the subsequent html element to turn the text wrapping off.
<img> Attributes
Attributes Description
src specifies the location of image file
alt alternative text in case the image does not display
title shows information as a tooltip text when the mouse moves over the
element.
width specifies the width of the image
height specifies the height of the image
Note: except for "src", all the other attributes are optional
• If the file is in another folder called ‘Media’ at the same level as the current
HTML folder:
<img src="../Media/myPicture.jpg">
• If the file is located in other websites, e.g. in the NP website Media folder :
<img src="http://www.np.edu.sg/Media/myPicture.jpg">
Image Size
Always specify both the height and width of the image.
This will reserve the space required for the image when the page is
loaded.
Example – Image-map
Animated Images
Animated Images
• Same as normal images
• Animated images are available in the
form of .gif file
Example
Adding Audio
Official (Closed) - Non Sensitive
<audio> example
The controls attribute adds audio controls, like play, pause, and
volume
The text between the <audio> and </audio> tags will be displayed
if the browser cannot play any of the listed audio.
<audio> Attributes
Adding Video
Official (Closed) - Non Sensitive
<video> Attributes
Attribute Value Description
autoplay autoplay If present, the video will start playing as soon as it is ready
controls controls If present, controls will be displayed, such as a play button
height pixels Sets the height of the video player
loop loop If present, the video will start over again, every time the
video ends
muted muted Specifies that the audio output of the video should be muted
poster url Specifies the URL of an image representing the video
auto Specifies if and how the author thinks the video should be
preload metadata loaded when the page loads
none
src url The URL of the video to play i.e. where to find the video
width Pixels Sets the width of the video player
Forms
Official (Closed) - Non Sensitive
HTML Forms
A feedback or survey form is an example of a form.
HTML forms allow a user to enter data that is sent to a
server for processing.
A form contains form elements that allow the user to enter
data.
• E.g. text field, checkbox, password, radio button, etc
A form is defined with the <form> tags.
<form>
…
input elements
…
</form>
A Form Example
Using Forms
Forms are usually used to submit information to another
program for processing
• such as *.aspx or *.php
To let the browser know where to send the form content, we
add these attributes to the <form> tag:
• action = address (where to send the form to for processing)
E.g.
action = "password_validation.asp" (name of the program on
the server receiving the form for processing)
action = "mailto:email@email.com"
• method = "post" or method = "get "
method="post"
Form Controls
Field Type HTML Code Notes
Plain text <input type="text"> Provides textbox to enter text
Email <input type="email"> Forces a valid email
Password field <input type="password"> Echoes dots instead of characters as you type
Checkbox <input type="checkbox"> Used for multiple selections
Radio button <input type="radio"> When in a group, use to select only one
Drop-down lists <select><option>… Provides a list of items in a dropdown menu
File picker <input type="file"> Pops up an “open file” dialog
Submit button <input type="submit"> To submit form to server program
Clickable button <input type="button"> Provides a clickable button
Web address <input type="url"> Example: http://www.google.com
<input type="number"
Numbers min="0" max="10" Forces numbers
step="2" value="6">
Date <input type="date"> Provides a date picker
Note: to select the Chinese language, user can click either the check box for Chinese
or the word Chinese
Radio Buttons
Radio Buttons are used when you want the user to select
one of a limited number of choices.
Use the name attribute to group the radio buttons in a group
so that only one button can be selected within the group.
Checkboxes
Checkboxes are used when you want the user to select one
or more options of a limited number of choices.
Text Area
Text area serves as a multi-line input field for users to enter their own
comments.
• Size can be specified by the rows and cols attributes for the
<textarea> tag.
• rows attribute specifies the visible number of lines in a text area.
• cols attribute specifies the visible width of a text area.
Styling Forms
Forms can be styled using CSS (to be covered next week). You can use
the style attribute to style the form before we learn CSS.
Reading Reference
http://www.w3schools.com/html/html5_intro.asp
http://www.w3schools.com/html/html_images.asp
http://www.w3schools.com/html/html5_audio.asp
http://www.w3schools.com/html/html5_video.asp
http://www.w3schools.com/html/html_forms.asp
https://www.tutorialspoint.com/html/html_forms.htm
Summary
Today we have learnt:
• Inserting images from different locations and modify
their size, position and create hot-spots.