Web Page Design With HTML
Web Page Design With HTML
• In most web browsers, the URL of a web page is displayed on top inside an
address bar. An example of a typical URL would be
"http://en.example.org/wiki/Main_Page".
• Or
• https://en.example.org/wiki/Main_Page
•Explanation:
•eg: scheme://host.domain:port/path/filename
6
How Web Works …
➢ User types a URL in the web browser.
➢ Web browser contacts the domain name service
DNS to find the IP Address of the server associated
with the domain name in URL.
➢ Web browser creates a TCP socket connection to
the server using the servers IP address and Port
number.
➢ Web browser sends an HTTP request to the server
asking for the file pointed by the URL.
➢ Server determines the file to be sent.
➢ Server sends response code and the document.
7
The Evolution of the Web
http://www.evolutionoftheweb.com/#/evolution/day
11
Web 1.0, 2.0 and 3.0 and 4.0
12
Web 1.0, 2.0 and 3.0 and 4.0 …
• Web 2.0 (The writing and participating web)
– It is the “writable” phrase of the World Wide Web with
interactive data. Unlike Web 1.0, Web 2.0 facilitates
interaction between web users and sites, so it allows
users to interact more freely with each other.
– Web 2.0 encourages participation, collaboration, and
information sharing. Examples of Web 2.0 applications
are Youtube, Wiki, Flickr, Facebook, and so on.
13
Web 1.0, 2.0 and 3.0 and 4.0 …
• Web 3.0 (The semantic executing web)
– It is the “executable” phrase of Word Wide Web with dynamic applications,
interactive services, and “machine-to-machine” interaction.
– Web 3.0 is a semantic web which refers to the future.
– Semantic markup refers to the communication gap between human web
users and computerized applications.
– In Web 3.0, computers can interpret information like humans and
intelligently generate and distribute useful content tailored to the needs of
users.
– One example of Web 3.0 is Tivo, a digital video recorder. Its recording
program can search the web and read what it finds to you based on your
preferences.
• The following attributes are going to be a part of Web 3.0: Contextual
Search
• Tailor made Search
• Personalized Search
• Evolution of 3D Web
• Deductive Reasoning
14
Web 1.0, 2.0 and 3.0 and 4.0 …
• Web 4.0 (Mobile Web)
– The next step is not really a new version, but is a
alternate version of what we already have. Web
needed to adapt to it’s mobile surroundings. Web
4.0 connects all devices in the real and virtual
world in real-time.
• Web 5.0- Open, Linked and Intelligent Web =
Emotional Web
15
Web 1.0, 2.0 and 3.0 and 4.0 …
16
Browser Market share
17
What is HTML
File Name
.html
All Files
• Grammar
• Tag
– A tag is a code used in the HTML document
– A tag is single-byte UPPERCASE/lowercase letters enclosed by
“<“ and “>” ( less than (<) and greater than (>))
– <HTML> tag at the beginning of the document
– </HTML> tag at the end of the document
HTML
Document
Header Body
Header is the starting section of Main contents of the HTML
the HTML document document
Description of the name of the Tags related to the display of
web page is enclosed between the web page are contained
the <HEAD> tag and the </HEAD> between the <BODY> tag and
tag the </BODY> tag
23
23 University of Colombo School of Computing
Grammar of the Tag
25
25 University of Colombo School of Computing
Font Face, Size and Color
Text Formatting
26
26 University of Colombo School of Computing
To combine Font Attributes…
Eg :-
<FONT SIZE= “16” TYPE=“ARIAL” COLOR=“RED”> My First Web Page</FONT>
Tag Description
<abbr> Defines an abbreviation or acronym
<address> Defines contact information for the author/owner of a document
<bdo> Defines the text direction
<blockquote> Defines a section that is quoted from another source
<cite> Defines the title of a work
<q> Defines a short inline quotation
<html>
<body>
<p>WWF's goal is to: <q>Build a future where people live in harmony with
nature.</q></p>
</body>
</html>
WWF's goal is to: “Build a future where people live in harmony with nature."
<html>
<body>
<blockquote cite="http://www.worldwildlife.org/who/index.html">
For 50 years, WWF has been protecting the future of nature. The world's leading
conservation organization, WWF works in 100 countries and is supported by
1.2 million members in the United States and close to 5 million globally.
</blockquote>
Browsers usually indent blockquote elements.
</body>
</html> For 50 years, WWF has been protecting the
future of nature. The world's leading
conservation organization, WWF works in 100
countries and is supported by 1.2 million
members in the United States and close to 5
million globally.
<html>
<body>
</body>
</html>
<html>
<body>
<p>If your browser supports bi-directional override (bdo), the next line
will be written from right to left (rtl):</p>
</body>
</html>
</BODY>
</HTML>
<body>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
</body>
36
36 University of Colombo School of Computing
Other Tags
<BR>
This tag is used to define line breaks <br/>
<!-- -- >
This tag is used to comment out line
Eg: <!-- table 1.1-->
# 000000 - BLACK
# ffffff - WHITE
Variation O~9 or a~f 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f
38 University of Colombo School of Computing 38
Color Theory
<I> - </I>
These tag is used to display italic text
Eg <I>My First Web Page</I>
• <B> - </B>
• These tag is used to display bold text
» Eg <B>My First Web Page</B>
<U> - </U>
These tag is used to display underline text
Eg <U> My First Web Page</U>
<SUP> - </SUP>
These tag is used to display Superscript text
Eg 2<SUP>nd</SUP>
• <SUB> - </SUB>
• These tag is used to display subscript text
» Eg H<SUB>2</SUB>
<STRIKE> - </STRIKE>
These tag is used to display strike out text
Eg <STRIKE> My First Web Page</STRIKE>
<html>
<body>
<h2>HTML <mark>Marked</mark>
Formatting</h2>
</body>
</html>
<body>
<marquee>This is basic example of marquee</marquee>
</body>
</html>
<HR>
This tag is used to display a border (horizontal rule)
Attribute of the <HR> tag can specify the thickness.
Length, left and right alignment.
<HR WIDTH=”70%” ALIGN=“LEFT”>
<OL> - </OL>
These tags are used to display the ordered list
They are used in combination with <LI> tag
<UL> - </UL>
These tags are used to display the unordered list
They are used in combination with <LI> tag
<LI>
This tag is used in the scope of the <OL> tags or the
<UL> tags described above for the display of a list item.
One <LI> tag is used for each list item
<!--nested tag-->
46 University of Colombo School of Computing
LISTS
<ul style="list-style-type:circle;">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
<ol start="50">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
<DL>
<DT>HTML</DT>
<DD>HyperText Markup Language</DD>
<DT>OS</DT>
<DD>Operating System</DD>
<DT>CSS</DT>
<DD>Cascading Style Sheets </DD>
</DL>
<TD> - </TD>
These tags define the data (cell) of the rows.
Adjust the Column width: <td width=100> - </td>
<TH> - </TH>
These tags define the Item names of the columns of the table.
50
50 University of Colombo School of Computing
TABLES …
“ROWSPAN”
The “ROWSPAN” attribute that specifies a cells
spanning across multiple rows
<TD ROWSPAN=“number of row”> - </TD>
“COLSPAN”
The “COLSPAN” attribute specifies a cell across
multiple columns
<TD COLSPAN=“number of column”> - </TD>
<CAPTION>-</CAPTION>
These tags define the caption of the table
They are used between the <TABLE> tag and the
first <TR> tag
ALIGN
The “ALIGN” attribute that specifies the
alignment of the text to be displayed next to the
image.
<IMG SRC=“image name” ALIGN=“position of the
character string”>
(TOP, MIDDLE & BOTTOM)
You can use the style attribute to specify the width and height of an image.
Example
<img src="img_girl.jpg" alt="Girl in a jacket" style="width:500px;height:600px;">
<figure>
<img src="../html/pic_trulli.jpg" alt="Trulli" style="width:100%">
<figcaption>Fig.1 - Trulli, Puglia, Italy.</figcaption>
</figure>
image
(1) (2)
abc abc
b.gif
a.html b.gif a.html
(3) (4)
61 University of Colombo School of Computing
Specifying Links to Other Pages
(Note: “/” = root folder)
(1) (2)
(3) (4)
62 University of Colombo School of Computing
HTML Links - Create a Bookmark
63
Links to the Same Page
<A HREF =“file name #anchor name”>-</A>
– Eg <a href="#B">Part B</a>
These tags and the option assign a name to an
arbitrary position in the HTML document.
Using a link defined by the <A> tags described
next, the position specified by these tags can be
display at the beginning of the browser screen.
Anchor name can be any alphabets
• Source Page:
– <a name=d><h1>Introduction</h1></a>
a.html b.html
Image/Button
<ADDRESS>
<A HREF=“mailto:user00@flm.co.jp”>Development Team</A>
</ADDRESS>
72
72 University of Colombo School of Computing
Image Map cont…
⚫ <IMG SRC=“image file name” ALT=“Comment” USEMAP=“#name of the map”>
⚫ These tags and the USEMAP attribute are used to display images to be
used as the image map.
Shapes: RECT CIRCLE POLY
<img>
(0,0)
(a,b) b (a,b)
(e,f)
a d (a,b)
C
(c,d) (c,d)
C
Shape=“rect” Shape=“circle” Shape=“poly”
Coords=“a,b,c,d” Coords=“a,b,c” Coords=“a,b,c,d,e,f”
(Centre & Radius)
<AREA SHAPE=“shape” COORDS=“specify coordinates” HREF=“file
name or URL” ALT=“comment”>
73
73 University of Colombo School of Computing
Forms
Textbox: Type=text
Textbox: Type=password
Radio Button: (Allow to select one item out of the given list
File field
Buttons
74
Using Forms
<FORM METHOD=“POST” ACTION=mailto:e-mail address ENCTYPE=“text/plain”> - </FORM>
Type of Data
These tags and the attributes are used to define the data
screen (HTML form)
The input data is sent as e-mail to the address specified for
the ACTION attribute.
Form Attribute types are as follows;
•Text
•password
•Radio
•Check box
•Submit
•Reset
75
75 University of Colombo School of Computing
Text boxes
<INPUT TYPE=“TEXT” NAME=“textbox name” SIZE=“length of the textbox”>
The <INPUT> tag and the attributes are used to define the
textbox
78
78 University of Colombo School of Computing
Radio Button
<INPUT TYPE=“RADIO” NAME=“radio button group name”
VALUE=“value to be sent”>-
These tags define an input area that contains more than 1 line of input
They are specified in the scope of the <FORM> tags
The character string described in the scope of the <TEXTAREA> tags is
displayed in the area as the initial value
In the e-mail to be sent, it is described as “name of input area=input
sentences”
</TEXTAREA>
This tag and the attributes define the button for sending input or selected
data
Press this button and e-mail will be sent to the address specified by the
ACTION attribute of the <FORM> tag.
This tag and the attributes define the button for clearing the input
data
82
82 University of Colombo School of Computing
HTML5 Input Types
<form action="action_page.php">
Quantity (between 1 and 5):
<input type="number" name="quantity" min="1" max="5">
<input type="submit">
</form>
<form action="action_page.php">
Quantity:
<input type="number" name="points“ min="0" max="100" step="10" value="30">
<input type="submit">
</form>
<form>
Birthday:
<input type="date" name="bday">
</form>
<form>
Enter a date before 1980-01-01:
<input type="date" name="bday" max="1979-12-31"><br>
Enter a date after 2000-01-01:
<input type="date" name="bday" min="2000-01-02"><br>
</form>
<form action="action_page.php">
Birthday (month and year):
<input type="month" name="bdaymonth">
<input type="submit">
</form>
<form>
Select a week:
<input type="week" name="week_year">
</form>
<form>
Select a time:
<input type="time" name="usr_time">
</form>
<form action="action_page.php">
Birthday (date and time):
<input type="datetime-local"
name="bdaytime">
<input type="submit" value="Send">
</form>
<form>
E-mail:
<input type="email" name="email">
</form>
88 University of Colombo School of Computing
HTML5 Input Type : Date -add restrictions to the input
<form>
Search Google:
<input type="search" name="googlesearch">
</form>
<form>
Add your homepage:
<input type="url" name="homepage">
</form>
<form action="action_page.php">
<input type="text" name="fname" placeholder="First name"><br>
<input type="text" name="lname" placeholder="Last name"><br>
<input type="submit" value="Submit">
</form>
Example
Group related elements in a form:
<form>
<fieldset>
<legend>Personalia:</legend>
Name: <input type="text"><br>
Email: <input type="text"><br>
Date of birth: <input type="text">
</fieldset>
</form>
To use the frame function, define the method for splitting the
browser and the file names of the web pages to be displayed
in different frames in the HTML file used for frame setting
Banner Area
(Logo/Company Name/Address)
ABC (Pvt) Ltd
Introduction
Home Aaaaaa aaaaaa aaaaaaaaa aaaaa
Aaaa aaaaaa aaaaaaaa aaaaaaaa
People Aaaaaa aaaaaa aaaaaaaaa aaaaa
Navigation About Us Aaaa aaaaaa aaaaaaaa aaaaaaaa
Area
Content Area Contact Us Aaaaaa aaaaaa aaaaaaaaa aaaaa
Aaaa aaaaaa aaaaaaaa aaaaaaaa
Help
The ROWS attribute the split the screen into top and bottom frames
•The target frame name that display the HTML file is specified in the
“TARGET” attribute
•The target frame name is the frame name assigned by the “NAME”
attribute of the <FRAME> tags.
•The frame that display the linked web page is specified by the
“TARGET” attribute.
94
94 University of Colombo School of Computing
NOFRAMES
• <NOFRAMES> - </NOFRAMES>
• These tags define the content of the web page to be
displayed for browsers that do not support the frame
function
consider the TARGET attribute in terms of frames and the <A> tag.
_self The user agent should load the document in the same frame
as the element that refers to this target.
_parent The user agent should load the document into the immediate
FRAMESET parent of the current frame. This value is equivalent to _self if
the current frame has no parent.
_top The user agent should load the document into the full, original
window (thus canceling all other frames). This value is equivalent to _self if
the current frame has no parent
<html>
<head>
<base target="_blank">
</head>
<body>
<p>
<a href="firstpage.html“ target="_blank">This link</a>
will load in a new window because the target attribute is set to "_blank".
</p>
<p>
<a href="firstpage.html">This link</a>
will also load in a new window even without a target attribute because base target is “_blank”.
</p>
</body>
</html>
<A HREF="mailto:saman17lk@yahoo.com">saman</a>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE>EMBEDED</TITLE>
</HEAD>
<BODY>
<EMBED SRC="SRILANKA.AVI" WIDTH="300" HEIGHT="350" PLAY="TRUE"
LOOP="TRUE" QUALITY="HIGH">
</BODY>
</HTML>
<html>
<body>
</body>
</html>
<html>
<body>
</body>
</html>
<IFRAME
NAME="abc"
SRC="Habitat.html"
WIDTH=300 HEIGHT=200>
</IFRAME></TD>
</TR></TABLE>
</body>
</html>
Example
Result:
109
HTML Standards….. for HTML Validation
• <?xml version="1.0" encoding="us-ascii"?>
• <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
• "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
• <html lang="en" xml:lang="en"">
• <head>
• <title>On Going Events</title>
• <link href="../css/default.css" rel="stylesheet" type="text/css"
title="Default" />
• <link href="../css/black.css" rel="alternate stylesheet" type="text/css"
title="High Contrast" />
• </head>
• <body>
• </body>
• </html>
<!DOCTYPE > Defines the document type and tells the browser which version
of the markup language the page is written in. This tag goes before the <html>
start tag.
110 University of Colombo School of Computing
HTML <meta> Tag
• Describe metadata within an HTML document
<head>
<meta name="description" content="Free Web tutorials" />
<meta name="keywords" content="HTML,CSS,XML,JavaScript" />
<meta name="author" content="Hege Refsnes" />
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
</head>
<details> Defines additional details that the user can view or hide
<dialog> Defines a dialog box or window
<figcaption> Defines a caption for a <figure> element
<section>
<h1>WWF</h1>
<p>The World Wide Fund for Nature (WWF)
is....</p>
</section>
• http://www.w3schools.com/html/html_intro.
asp
• CSS validator
– http://jigsaw.w3.org/css-validator/
122
Popular Stacks
123
124
Advantages & Disadvantages
The advantage of being a full stack web developer is:
•You can master all the techniques involved in a development project
•You can make a prototype very rapidly
•You can provide help to all the team members
•You can reduce the cost of the project
•You can reduce the time used for team communication
•You can switch between front and back end development based on
requirements
•You can better understand all aspects of new and upcoming technologies
Disadvantages
• The solution chosen can be wrong for the project
• The solution chosen can be dependent on developer skills
• The solution can generate a key person risk
• Being a full stack developer is increasingly complex
125