ch3 Html-Cont
ch3 Html-Cont
• The browser has to load multiple HTML files before a user can
view the contents of the site increasing the waiting time for
potential customers
• Some web authors feel that frames are too constricting, limiting
flexibility in designing the layout of a Web page
• There is concern that frames can use up valuable screen space
• The source code is removed from the user
or
– <frameset cols=“column1,column2,column3, . .
.”> </frameset>
two columns of
frames nested in the
second frame row
Some Web designers prefer not to show frame borders in order to give the illusion of having a
single Web page rather than three separate ones, while other Web designers believe that
hiding frame borders can confuse users as they navigate the Web site.
HTML code to
create an inline
frame
• Inline media clips are placed into the Web page itself as
embedded objects.
– a downside of using inline media is that the user is
forced to wait for the clip to be retrieved by the browser
– inline media is intended for users with access to the
Web page using a high-speed connection
• An embedded media clip works like an inline image and
can be played within the Web page itself.
inline
external
Creating Web Pages with HTML 57
Prepared by: C. Hueckstaedt
XP
Playing a Multimedia Clip
• To embed a sound clip into a Web page, use the <embed> tag.
• The syntax of the <embed> tag is:
<embed src=“URL” width=“value” height=“value”
align=“value” autostart=“startvalue”>
– URL is the filename and location of the embedded object
– height and width attributes define the size of the embedded object on
the Web page
– align attribute defines how text wraps around the embedded clip
– autostart attribute is used to determine whether or not the browser
starts the embedded clip automatically when the Web page is loaded
embedded
sound clip
sound clip
does not play
width and automatically
height of sound
clip controls
embedded video
clip and controls
(your controls
may differ)
text box
First Name Last Name
This figure shows a Address #1
elements Country
• Setting the width of a text box does not limit the number of
characters the box can hold.
– if a user enters text longer than the box’s width, the text scrolls
to the left
– the user cannot see the entire text, but all of it is sent to the
CGI script for processing
• The syntax for setting the maximum length for field input is:
<input maxlength=“value”>
– value is the maximum number of characters that can be stored
in the field
no more than 5
characters are
allowed in this text
box
If customers from countries other than the United States use this Web form,
they can remove the default value by selecting the text and pressing the Delete key.
default value
value of the id
attribute for the first
name field
option
a single group label
option
group a single option
group
This figure shows an example of HTML code that creates radio buttons for party affiliations.
In this sample code, the value sent to the CGI script does not match the field label.
If the user selects the Republican radio button, the value “gop”
is sent to the CGI script paired with the field name “party.”
Creating Web Pages with HTML 99
Prepared by: C. Hueckstaedt
XP
Selection Lists vs. Radio Buttons
• A check box is either selected or not, there is only one check box
per field.
• Check boxes are created using the following syntax:
<input type=“checkbox” name=“name” id=“id”
value=“value”>
– name and id attribute identify the check box
– the value attribute specifies the value that is sent to the CGI,PHP etc.
script when the check box is selected
• The <input> tag for a check box does not display any text.
• Check boxes are not selected by default.
– to do this, add the checked attribute to the <input> tag
This figure shows different check boxes. The user can click either the check box or the
label associated with the check box to select and deselect.
The text entered in a text area wraps to the next line when it exceeds the width of the box.
To control how a browser wraps text to a new line use the wrap attribute.
This figure shows the three possible wrap options.
116
XP
HTML5 Input Types (2)
http://www.php-intro.com/code/forms/html5.php
117