Internet Programming(HTML)
Internet Programming(HTML)
Chapter two
HTML
The <title> element should contain only the text for the title and
it may not contain any other elements.
Example:
<head>
<title>HTML Basic tags</title>
</head>
Attributes:
ALIGN= allows you to specify how your
paragraph should be aligned on the page.
Possible values are: LEFT, RIGHT and CENTER.
e.g: <P ALIGN="center">
Prepared by Haimanot B. 12/20/2024
How text inside paragraphs is displayed…
Example
<html>
<body>
<p>Here is a paragraph of text.</p>
<p>Here is a second paragraph of text.</p>
<p>Here is a third paragraph of text.</p>
</body>
</html>
Insert an address
Address tag <address> </address>
It is a standard to put address texts inside
the address tags.
Example
<html><body>
<address> Mizan-Tepi University <br> BOX
121 <br>Tepi<br> Ethiopia </address>
</body></html>
Prepared by Haimanot B. 12/20/2024
Text formatting…
Acronyms <acronym> </ acronym >
Are used to write short representation of
words.
Acronym works only for in IE 5, in Netscape
6.2 and later.
Attributes:
TITLE= is used to show the spelled-out
version when holding the mouse pointer
over the acronym.
e.g: <acronym title="World Wide
Web">WWW</acronym>
Prepared by Haimanot B. 12/20/2024
Text formatting…
Bi Directional Override <bdo> </bdo>
The <bdo> element overrides the default text direction.
Attributes:
DIR= allows you to specify the text direction, it takes the
value “ltr” for left to right expression and “rtl” expression
e.g: <bdo dir = dir="rtl"> the text goes here!</bdo>
Example
<html><body>
<p>If your browser supports bi-directional override
(bdo), the next line will be written from the right to the
left (rtl):</p> <bdo dir="rtl">Here is some Hebrew
text</bdo>
</body></html>
<a href="glossary.html#Examples">See
the Examples</a>
<a href="mailto:name@example.com">
name@example.com</a>
<a href="mailto:name@example.com">E-
mail us</a>
Entity Entity
Result Description
Name Number
non-
breaking  
space
< less than < <
greater
> > >
than
ampersan
& & &
d
quotation
" " "
mark
'
Prepared by Haimanot B. apostroph (does 12/20/2024
' '
e not work
Coding Sound in HTML
Sound Formats
There are many sound formats supported by web
page.
The three most popular formats are WAVE, AU, and
MIDI.
WAVE (Waveform Audio File Format, with the file
extension .wav) was invented for Windows by Microsoft.
AU (Audio File Format, file extension .au) was invented
by Sun. It is widely accepted on many platforms, and are
common on web pages.
MIDI (Musical Instrument Digital Interface)
The standard file extensions for MIDI are ".mid" and ".midi".
<frameset cols="10%,*">
Prepared by Haimanot B. 12/20/2024
Width of column
Absolute Values in Pixels
use a number
Cols="100, 500, *" - - three columns 100,
500 and the rest
Cols="100, 100, 100" – will produce three
frames of size100, but if the screen size is
600px it will produce three 200 px size
frames
Cols= “100,100,100,*” will produce three
exactly 100px frames and one frame to fill
the rest of the space
<html>
<frameset cols="20%,80%">
<frame src="pageone.html">
<frame src="pagetwo.html#C10">
</frameset>
</html>
<html><body>
<form action=“www.server.com/script.php"
method="get">
<h1>Enter The Following Data </h1>
First Name :   <input type="text"
size="25"><br><br>
Middle name :<input type="text"
maxlength="5"><br><br>
Departement: <input type="text" value=“Information
Technology" disabled >
<br><br>
</form>
</body></html>
Prepared by Haimanot B. 12/20/2024
Single-line text field …
<html><body>
<form action=“www.server.com/script.php"
method="get">
<h4>Enter The Following Data </h4>
<table>
<tr><td>First Name :</td><td><input type="text"
size="20"> </input></td></tr>
<tr><td>Middle name :</td><td><input type="text"
maxlength="5"></td></tr>
<tr><td>Departement:</td><td><input type="text"
value=“Information Technology" ></td></tr>
</table>
</form></body></html>
Prepared by Haimanot B. 12/20/2024
Password text entry field
The Input Password Tag specifies a text field that
you can use to have visitors enter a password .
A password field works just like a text entry field,
except the characters are hidden as it is entered
(usually by replacing the characters with asterisks
or bullet)
Syntax: <input type="password"/>
Example:
Log in:<input type="password” name="pswd"
size="8" maxlength=“6" id="form-pswd" />
Attributes:
rows =Specifies the number of lines of text the
area should display. Scrollbars will be provided if
the user types more text than the allotted space.
cols =Specifies the width of the text area
measured in number of characters
disabled =allows you to display an option field but
the visitor will not be allowed to fill in to it.
e.g: <textarea disabled>
Prepared by Haimanot B. 12/20/2024
Multiline text entry field …
<html>
<body>
<form action="www.server.com/script.php"
method="get">
<h4>enter your suggestion here</h4>
<textarea cols=“50" rows=“6" >
Tell us why you love our web site in 50 words or less.
</textarea>
</form>
</body></html>
Example
<html><body>
<form action=“www.server.com/script.php" method="get">
<h3>Enter The Following Data </h3>
First Name :   <input type="text"><br><br>
Example
<form action="/client.php" method="post“
enctype="multipart/formdata">
<p><label for="form-photo">Send a photo to be used as
your online icon (optional):</label><br />
<input type="file" name="photo" size="28" id="form-
photo"/></p>
</form>
Prepared by Haimanot B. 12/20/2024
HTML Form …
How does a web form work?
A visitor visits a web site that contains a
form.
The web browser displays the HTML form.
The visitor fills in the form and submits
The browser sends the submitted form data
to the web server
A script running on the web server processes
the form data
A response page is sent back to the browser.
H1 {color:red;font-family:aerial}
H2 {color:red;font-family:aerial}
H3 {color:red;font-family:aerial}