Fundamentals of Web
Fundamentals of Web
of Web
Engineered for
Tomorrow
Date
18-11-13
8/10/2019
Origins
In the 1960s, the U.S. Department of Defense (DoD) developed a
new largescale computer network for communications, program
sharing, and remote computer access for researchers working on
defense-related contracts.
8/10/2019
Drawbacks:
8/10/2019
BITNET and CSNET
8/10/2019
A new national network, NSFnet, was created in 1986, sponsored, by
the National Science Foundation (NSF).
8/10/2019
What Is the Internet?
The Internet is a huge collection of computers connected in a
communications network.
8/10/2019
An IP address consists of 32 bits, often shown as 4 octets of numbers
from 0-255 represented in decimal form instead of binary form.
8/10/2019
Class A Network
In a Class A Network binary address start with 0, therefore the
decimal number can be anywhere from 1 to 126.
The first 8 bits (the first octet) identify the network and the remaining
24 bits indicate the host within the network.
8/10/2019
Class B Network
In a Class B Network, binary addresses start with 10, therefore the
decimal number can be anywhere from 128 to 191.
The first 16 bits (the first two octets) identify the network and the
remaining 16 bits indicate the host within the network.
8/10/2019
Class C Network
Binary addresses start with 110, therefore the decimal number can be
anywhere from 192 to 223.
The first 24 bits (the first three octets) identify the network and the
remaining 8 bits indicate the host within the network.
8/10/2019
Class D Network
In a Class D Network, binary addresses start
with 1110, therefore the decimal number
can be anywhere from 224 to 239.
Class D networks are used to
support multicasting.
Class E Network
In a Class E Network, binary addresses start
with 1111, therefore the decimal number
8/10/2019
Domain Names
8/10/2019
Every domain name has a suffix that indicates which top level
domain (TLD) it belongs to. There are only a limited number of such
domains. For example:
8/10/2019
Hostnames are human-readable nicknames that correspond to the
address of a device connected to a network.
The hostname and all of the domain names are together called a
fully qualified domain name.
8/10/2019
Because IP addresses are the addresses used internally by the
Internet, the fully qualified domain name of the destination for a
message,, must be converted to an IP address before the message
can be transmitted over the Internet to the destination.
DNS technology allows you to type names into the Web browser
like compnetworking.about.com and the computer to automatically
find that address on the Internet.
8/10/2019
All document requests from browsers are routed to the
nearest name server. If the name server can convert
the fully qualified domain name to an IP address, it
does so.
If it cannot, the name server sends the fully qualified
domain name to another name server for conversion.
Like IP addresses, fully qualified domain names must
be unique.
Figure 1.1 shows how fully qualified domain names
requested by a browser are translated into IPs before
they are routed to the appropriate Web server.
8/10/2019
Domain Name Conversion
8/10/2019
By the mid-1980s, a collection of different protocols that run on top of
TCP/IP had been developed to support a variety of Internet uses. Among
these protocols, the most common were :
mailto : which was developed to allow messages to be sent from the user
of one computer on the Internet to other users of other computers on the
Internet.
8/10/2019
The World Wide Web
Origins
In 1989, a small group of people led by Tim Berners-Lee
at CERN (Conseil Européen pour la Recherche
Nucléaire, or European Organization for Particle
Physics) proposed a new protocol for the Internet, as
well as a system of document access to use it.
8/10/2019
The proposed new system was designed to allow a user anywhere on
the Internet to search for and retrieve documents from databases on
any number of different document-serving computers connected to
the Internet.
For the form of its documents, the system used hypertext, which is text
with embedded links to text in other documents to allow
nonsequential browsing of textual material.
8/10/2019
Web or internet
8/10/2019
Web Browsers
A web browser (commonly referred to as a browser) is a software
application for retrieving, presenting and traversing information
resources on the World Wide Web.
When two computers communicate over some network, in many
cases one acts as a client and the other as a server.
The client initiates the communication, which is often a request for
information stored on the server, which then sends that information
back to the client.
The Web, as well as many other systems, operates in this client-server
configuration.
8/10/2019
Web browser function
8/10/2019
Documents provided by servers on the Web are requested by
browsers, which are programs running on client machines.
They are called browsers because they allow the user to browse the
resources available on servers.
8/10/2019
In the simplest case, a browser requests a static document from a
server. The server locates the document among its servable
documents and sends it to the browser, which displays it for the user.
The server may also provide a document that requests input from the
user through the browser. After the user supplies the requested input,
it is transmitted from the browser to the server, which may use the
input to perform some computation and then return a new
document to the browser to inform the user of the results of the
computation.
8/10/2019
Commonly used browsers
Microsoft Internet Explorer (IE),
Firefox,
Google chrome
Netscape Navigator,
Opera
Apple’s Safari……..many more.
8/10/2019
Web Servers
8/10/2019
Web Server Operation
8/10/2019
All the communications between a web client and a web server use
the HTTP
When a web server begins execution, it informs the OS under which it
is running & it runs as a background process
A web client or browser, opens a network connection to a web
server, sends information requests and possibly data to the server,
receives information from the server and closes the connection.
The primary task of web server is to monitor a communication port on
host machine, accept HTTP commands through that port and
perform the operations specified by the commands.
When the URL is received, it is translated into either a filename or a
program name.
8/10/2019
General characteristics of web server:
The file structure of a web server has two separate directories
document root :stores web documents
server root : stores server and its support softwares.
The files stored directly in the document root are those available to
clients through top level URLs
Some servers can serve documents that are in the document root of
other machines on the web; in this case they are called as proxy
servers
8/10/2019
Apache
Apache is the most widely used Web server.
The primary reasons are as follows:
It is is both fast and reliable.
It is open-source software, which means that it is free.
Apache is capable of providing a long list of services beyond the
basic process of serving documents to clients.
8/10/2019
IIS
8/10/2019
Uniform Resource Locators
(URLs)
8/10/2019
URLs can never have embedded spaces
It cannot use special characters like semicolons, ampersands
and colons
The path to the document for http protocol is a sequence of
directory names and a filename, all separated by whatever
special character the OS uses. (forward or backward slashes)
The path in a URL can differ from a path to a file because a URL
need not include all directories on the path
A path that includes all directories along the way is called a
complete path.
Example: http://www.webopedia.com/index.html
In most cases, the path to the document is relative to some
base path that is specified in the configuration files of the server.
Such paths are called partial paths.
Example: http://www.webopedia.com/
8/10/2019
MULTIPURPOSE INTERNET
MAIL EXTENSIONS
8/10/2019
if the type is video or audio, it cannot render the
document
It has to take the help of other software like media player,
win amp etc.,
These softwares are called as helper applications or
plugins
These non-textual information are known as HYPER MEDIA
This helper application will be used for rendering the
document by browser.
The list of MIME specifications is stored in configuration
file of web server.
8/10/2019
Hypertext Transfer Protocol
All Web communications transactions use the same protocol: the
Hypertext Transfer Protocol (HTTP).
Hypertext is structured text that uses logical links (hyperlinks)
between nodes containing text. HTTP is the protocol to exchange or
transfer hypertext.
HTTP consists of two phases: the request and the response.
Each HTTP communication (request or response) between a browser
and a Web server consists of two parts: a header and a body.
The header contains information about the communication; the
body contains the data of the communication if there is any.
8/10/2019
8/10/2019
The protocol is typically http, but it can also be https for secure
communications. The default port is 80, but one can be set
explicitly, as illustrated in the above image. The resource path is
the local path to the resource on the server.
8/10/2019
The Request Phase
8/10/2019
8/10/2019
8/10/2019
Few request methods defined by HTTP are:
8/10/2019
Two commonly used methods for a request-response between a
client and server are: GET and POST.
8/10/2019
The format of a header field is the field name followed by a colon
and the value of the field. There are four categories of header fields:
8/10/2019
A wildcard character, the asterisk (*), can be used to
specify that part of a MIME type can be anything.
8/10/2019
The Host: host name request field gives the name of the host. The
Host field is required for HTTP 1.1.
If the request has a body, the length of that body must be given with
a Content-length field.
8/10/2019
The Response Phase:
The general form of an HTTP response is as follows:
1. Status line
2. Response header fields
3. Blank line
4. Response body
The status line includes the HTTP version used, a three-digit status code
for the response, and a short textual explanation of the status code.
For example, most responses begin with the following:
HTTP/1.1 200 OK
8/10/2019
The status codes begin with 1, 2, 3, 4, or 5. The general meanings of
the five categories specified by these first digits are shown in Table.
One of the more common status codes is : 404 Not Found, which
means the requested file could not be found.
8/10/2019
HTTP Request
URL http://www.test101.com/doc/index.html
8/10/2019
HTTP Response
HTTP/1.1 200 OK
Date: Sun, 18 Oct 2009 08:56:53 GMT
Server: Apache/2.2.14 (Win32)
Last-Modified: Sat, 20 Nov 2004 07:16:26 GMT
Content-Length: 44
Connection: close
Content-Type: text/html
<html><body><h1>It works!</h1></body></html>
8/10/2019
XHTML
8/10/2019
Why XHTML ?
8/10/2019
The following HTML code will work fine if you view it in a browser
(even if it does NOT follow the HTML rules):
<html>
<head>
<title>This is bad HTML</title>
<body>
<h1> HTML
<p>This is a paragraph
</body>
8/10/2019
The Most Important Differences
from HTML:
Document Structure
XHTML DOCTYPE is mandatory
The xmlns attribute in <html> is mandatory
<html>, <head>, <title>, and <body> are mandatory
XHTML Elements
XHTML elements must be properly nested
XHTML elements must always be closed
XHTML elements must be in lowercase
XHTML documents must have one root element
8/10/2019
XHTML Attributes
Attribute names must be in lower case
Attribute values must be quoted
Attribute minimization is forbidden
8/10/2019
BASIC SYNTAX
The fundamental syntactic units of HTML are called tags.
In general, tags are used to specify categories of content.
The syntax of a tag is the tag’s name surrounded by angle brackets (<
and >).
Tag names must be written in all lowercase letters.
Most tags appear in pairs: an opening tag and a closing tag.
The name of a closing tag is the name of its corresponding opening tag
with a slash attached to the beginning. For example, if the tag’s name is
p, the corresponding closing tag is named /p.
Whatever appears between a tag and its closing tag is the content of the
tag. Not all tags can have content.
The opening tag and its closing tag together specify a container for the
content they enclose.
The container and its content together are called an element.
8/10/2019
Example: <p> Web Programming </p>
The paragraph tag, <p>, marks the beginning of the content; the
</p> tag marks the end of the content of the paragraph element.
Attributes, which are used to specify alternative meanings of a tag,
can appear between an opening tag’s name and its right angle
bracket.
They are specified in keyword form, which means that the attribute’s
name is followed by an equal’s sign and the attribute’s value.
<img src = “flower.jpg” />
Attribute names, like tag names, are written in lowercase letters.
Attribute values must be delimited by double quotes.
8/10/2019
Comments in programs increase the readability of those
programs. Comments in XHTML have the same purpose.
They can appear in XHTML in the following form:
<!-- anything except two adjacent dashes -->
Browsers ignore XHTML comments—they are for people
only. Comments can be spread over as many lines as are
needed. For example, you could have the following
comment:
8/10/2019
Standard XHTML Document
Structure
XHTML document begins with an xml declaration element that simply
identifies the document as being one based on XML. This element
includes an attribute that specifies the version number 1.0.
The xml declaration usually includes a second attribute, encoding,
which specifies the encoding used for the document [utf-8].
Following is the xml declaration element, which should be the first line
of every XHTML document:
<?xml version = "1.0" encoding = "utf-8"?>
8/10/2019
An XHTML document must include the four tags <html>, <head>,
<title>, and <body>.
The <html> tag identifies the root element of the document. So,
XHTML documents always have an <html> tag immediately following
the DOCTYPE command, and they always end with the closing html
tag, </html>.
8/10/2019
An XHTML document consists of two parts, named the head and the
body.
The <head> element contains the head part of the document,
which provides information about the document and does not
provide the content of the document.
The body of a document provides the content of the document.
The content of the title element is displayed by the browser at the
top of its display window, usually in the browser window’s title bar.
8/10/2019
<?xml version = "1.0" encoding = "utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml1-strict.dtd">
<!-- complete.html A document which must be followed
throughout the notes -->
<html xmlns = "http://www.w3.org/1999/xhtml">
<head> <title> My first program </title> </head>
<body>
<p> Programming the WEB..!! </p>
</body>
</html>
8/10/2019
8/10/2019
It beginsParagraphs:
with <p> and ends with </p>. Multiple
paragraphs may appear in a single document.
Trials_1.html
<?xml version = "1.0" encoding = "utf-8"?>
<head>
</head>
<body>
<p> Web programming refers to the writing, markup and coding involved in
Web development </p>
<p> It includes Web content, Web client and server scripting and network
security. </p>
</p>
</body>
8/10/2019
</html>
OUTPUT
8/10/2019
Line Breaks
8/10/2019
<?xml version = "1.0" encoding = "utf-8"?>
<head>
</head>
<body>
<p> Web programming refers to the writing, markup and coding involved in Web
development. <br />
It includes Web content, Web client and server scripting and network security. </p>
</p>
</body>
</html>
8/10/2019
OUTPUT
8/10/2019
Preserving White Space
Sometimes it is desirable to preserve the white space in text—
that is, to prevent the browser from eliminating multiple spaces
and ignoring embedded line breaks Pre.html
<?xml version = "1.0" encoding = "utf-8"?>
<html>
<body>
<p> <pre>
Web programming refers to the
writing,
markup
and coding
involved in Web development.
</pre>
</p>
</body>
</html>
8/10/2019
Output
8/10/2019
Headings
<html>
<body>
</body>
</html>
8/10/2019
output
8/10/2019
Font Styles and Sizes
A collection of tags are available to set font styles and sizes. For
example, <i> specified italics and <b> specified bold. Since the
advent of cascading style sheets the use of these tags has become
less.
Other tags used are the emphasis tag, the strong tag,
The emphasis tag, <em>, specifies that its textual content is special
and should be displayed in some way that indicates this
distinctiveness. Most browsers use italics for such content.
The strong tag, <strong> : Browsers often set the content of strong
elements in bold.
Practice1.html
8/10/2019
Subscript and superscript characters can be specified
by the <sub> and <sup> tags, respectively.These are
not content-based tags.
For example, x<sub>2</sub><sup>3</sup> +
y<sub>1</sub><sup>2</sup>
8/10/2019
8/10/2019
XHTML tags are categorized as being either block or inline.
The content of an inline tag appears on the current line. So, an inline
tag does not implicitly include a line break. One exception is br,
which is an inline tag, but its entire purpose is to insert a line break in
the content.
A block tag breaks the current line so that its content appears on a
new line.
The heading and block quote tags are block tags, whereas <em>
and <strong> are inline tags.
8/10/2019
Character Entities
XHTML provides a collection of special characters that are sometimes
needed in a document but cannot be typed as themselves.
The collection include the special characters like >,< and &, and also
the characters that do not appear on keyboards, such as small
raised circles that represents degrees in reference to temperature
etc.
These special characters are defined as entities, which are codes for
the characters. An entity in a document is replaced by its associated
character by the browser.
Table 1 lists some of the most commonly used entities.
Char_entity.html
8/10/2019
8/10/2019
Horizontal Rules
The parts of a document can be separated from each other, making
the document easier to read, by placing horizontal lines between
them. Such lines are called horizontal rules, and the block tag that
creates them is <hr />.
The <hr /> tag causes a line break (ending the current line) and
places a line across the screen. The browser chooses the thickness,
length, and horizontal placement of the line.
Typically, browsers display lines that are three pixels thick. Note again
the slash in the
<hr /> tag, indicating that this tag has no content and no closing tag.
Hr.html
8/10/2019
<?xml version = "1.0" encoding = "utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
http://www.w3.org/TR/xhtml11/DTD/xhtml1-strict.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<body>
<h1>HTML</h1>
<p>HTML is a language for describing web pages.</p>
<hr/>
<h1>CSS</h1>
<p>CSS defines how to display HTML elements.</p>
</body>
</html>
8/10/2019
8/10/2019
Images
The inclusion of images in a document can dramatically enhance its
appearance.
The image is stored in a file, which is specified by an XHTML request.
The image is inserted into the display of the document by the
browser.
Image Formats
The two most common methods of representing images are the
Graphic Interchange Format (GIF) and the Joint Photographic
Experts Group (JPEG) format.
Files in both formats are compressed to reduce storage needs and
provide faster transfer over the Internet.
8/10/2019
GIF v/s JPEG
JPEG
GIF
GIF images are bigger than JPEG images JPEG images are comparatively small
8/10/2019
A third image format is Portable Network Graphics (PNG,
pronounced ping).
PNG was designed in 1996. PNG is a good replacement for both GIF
and JPEG because it has the best characteristics of each (the
possibility of transparency, as provided by GIF, and the same large
number of colors as JPEG).
8/10/2019
Images
8/10/2019
If the browser is not capable of displaying images, or if the Internet
connection is slow and the user chooses not to wait for images to
download, in any case, it is helpful to have some text displayed in
place of the ignored image.
8/10/2019
<?xml version = "1.0" encoding = "utf-8"?>
<head>
</head>
<body>
<h4> The <img> tag creates a holding space for the referenced
image.</h4>
</body>
</html>
8/10/2019
8/10/2019
Hypertext Links
8/10/2019
Links
8/10/2019
If the target is in another document in the same directory, the target is just
the document’s file name.
If the document is on some other machine (not the server providing the
document that includes the link), obviously the complete URL must be used.
The content of an anchor tag, which becomes the clickable link the user
sees, is restricted to text, images, and headings.
Links are usually implicitly rendered in a different colour than that of the
surrounding text. Sometimes they are also underlined.
8/10/2019
When the mouse cursor is placed over the anchor-tag
content and the left mouse button is pressed, the link is
taken by the browser.
8/10/2019
<?xml version = "1.0" encoding = "utf-8"?>
<head>
</head>
<body>
<h2> Web programming refers to the writing, markup and coding involved in Web
development.</h2>
<h3>It includes Web content, Web client and server scripting and network security.
</h3>
</body>
</html>
8/10/2019
8/10/2019
15.2 Targets within Documents
If the target of a link is not at the beginning of a document, it must be
some element within the document, in which case there must be some
means of specifying it.
The target element can include an id attribute, which can then be used
to identify it in an href attribute.
Consider the following example:
<h2 id = “avionics”> Avionics </h2>
Nearly all elements can include an id attribute.
8/10/2019
When the What about avionics? link is taken, the
browser moves the display so that the h2 element
whose id is avionics is at the top.
8/10/2019
2.7 Lists
• Unordered lists
• The list is the content of the <ul> tag
• List elements are the content of the <li> tag
<h3> Some Common Single-Engine Aircraft </h3>
<ul>
<li> Cessna Skyhawk </li>
<li> Beechcraft Bonanza </li>
<li> Piper Cherokee </li>
</ul>
• Ordered lists
• The list is the content of the <ol> tag
• Each item in the display is preceded by a sequence value
8/10/2019
2.7 Lists (continued)
• Nested lists
• Any type list can be nested inside any type list
• The nested list must be in a list item
8/10/2019
2.7 Lists (continued)
8/10/2019
2.8 Tables
8/10/2019
2.8 Tables (continued)
8/10/2019
2.8 Tables (continued)
8/10/2019
2.8 Tables (continued)
8/10/2019
2.8 Tables (continued)
8/10/2019
2.8 Tables (continued)
- Table Sections
- Header,
tfoot body, and footer, which are the elements: thead, tbody, and
- If a document
thicker haslines
horizontal multiple tbody elements, they are separated by
8/10/2019
2.9 Forms
8/10/2019
2.9 Forms (continued)
8/10/2019
2.9 Forms (continued)
8/10/2019
2.9 Forms (continued)
Widgets (continued)
Grocery Checklist
<form action = "">
<p>
<input type = "checkbox" name ="groceries"
value = "milk" checked = "checked">
Milk
<input type = "checkbox" name ="groceries"
value = "bread">
Bread
<input type = "checkbox" name = "groceries"
value= "eggs">
Eggs
</p>
</form>
8/10/2019
2.9 Forms (continued)
Widgets (continued)
3. Radio Buttons (continued)
If no button in a radio button group is ‘pressed’, the browser often ‘presses’
the first one
Age Category
<form action = "">
<p>
<input type = "radio" name = "age"
value = "under20" checked = "checked"> 0-19
<input type = "radio" name = "age"
value = "20-35"> 20-35
<input type = "radio" name = "age"
value = "36-50"> 36-50
<input type = "radio" name = "age"
value = "over50"> Over 50
</p>
</form>
8/10/2019
2.9 Forms (continued)
8/10/2019
2.9 Forms (continued)
Widgets (continued)
3. Menus (continued)
Each item of a menu is specified with an <option> tag, whose
pure text content (no tags) is the value of the item
An <option> tag can include the selected attribute, which when
assigned "selected” specifies that the item is preselected
Grocery Menu - milk, bread, eggs, cheese
<form action = "">
<p>
With size = 1 (the default)
<select name = "groceries">
<option> milk </option>
<option> bread </option>
<option> eggs </option>
<option> cheese </option>
</select>
</p>
</form>
8/10/2019
2.9 Forms (continued)
- Widgets (continued)
8/10/2019
2.9 Forms (continued)
- Widgets (continued)
5. Text areas - created with <textarea>
Usually include the rows and cols attributes to specify the size of
the text area
Default text can be included as the content of <textarea>
Scrolling is implicit if the area is overfilled
Please provide your employment aspirations
<form action = "">
<p>
<textarea name = "aspirations" rows = "3”
cols = "40">
(Be brief and concise)
</textarea>
</p>
</form>
8/10/2019
2.9 Forms (continued)
Widgets (continued)
6. Reset and Submit buttons
Both are created with <input>
<input type = "reset" value = "Reset Form">
<input type = "submit” value = "Submit Form">
Submit has two actions:
1. Encode the data of the form
2. Request that the server execute the server-resident program
specified as the value of the action attribute of <form>
A Submit button is required in every form
--> SHOW popcorn.html and display it
8/10/2019
2.10 Frames
8/10/2019
2.10 Frames (continued)
8/10/2019
2.10 Frames (continued)
8/10/2019
<meta> tag
Metadata is data (information) about data.
8/10/2019
Attribute
Explanation
name
Description of the web page. This again can be used
description by various search engines while indexing your
webpage for searching purpose.
Used to list keywords that describe the content of the
web page
keywords
later these keywords are used by the search engines
while indexing your webpage for searching purpose..
creator or The organization or person who responsible for creating
author the webpage.
date The date of publication in yyyy-mm-dd format.
identifier A unique number identifying a web page.
Language of the page. Use a two-character language
language
code.
rights Used for adding copyright statement.
8/10/2019
http-euiv attributes :
The http-euiv attributes are equivalent to HTTP headers and control
the action of a browser on a requested page.
8/10/2019
Example 1 - Define keywords for search
engines:
<meta name="keywords" content="HTML,
CSS, XML, XHTML, JavaScript">
Example 2 - Define a description of your
web page:
<meta name="description"
content=“Programming the Web">
Example 3 - Define the author of a page:
<meta name="author" content=“Robert
Sabesta">
Example 4 - Refresh document every 30
8/10/2019
Content of <blockquote>
Blockquotes
To set a block of text off from the normal flow and appearance of text
Browsers often indent, and sometimes italicize.
<html>
<head>
<title>HTML blockquote Tag</title>
</head>
<body>
<p>Browsers generally render blockquote text as indented text. If your
quoted text needs to display within a non-quoted paragraph, you
should use the HTML q tag. Most browsers surround q text with
quotation marks.</p>
8/10/2019
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
</body>
</html>
8/10/2019
Output
8/10/2019
XHTML Document Validation
8/10/2019
8/10/2019
8/10/2019
THANK YOU