Web Technologies Bachelors in technology notes

PALAK63 8 views 130 slides Jul 11, 2024
Slide 1
Slide 1 of 130
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68
Slide 69
69
Slide 70
70
Slide 71
71
Slide 72
72
Slide 73
73
Slide 74
74
Slide 75
75
Slide 76
76
Slide 77
77
Slide 78
78
Slide 79
79
Slide 80
80
Slide 81
81
Slide 82
82
Slide 83
83
Slide 84
84
Slide 85
85
Slide 86
86
Slide 87
87
Slide 88
88
Slide 89
89
Slide 90
90
Slide 91
91
Slide 92
92
Slide 93
93
Slide 94
94
Slide 95
95
Slide 96
96
Slide 97
97
Slide 98
98
Slide 99
99
Slide 100
100
Slide 101
101
Slide 102
102
Slide 103
103
Slide 104
104
Slide 105
105
Slide 106
106
Slide 107
107
Slide 108
108
Slide 109
109
Slide 110
110
Slide 111
111
Slide 112
112
Slide 113
113
Slide 114
114
Slide 115
115
Slide 116
116
Slide 117
117
Slide 118
118
Slide 119
119
Slide 120
120
Slide 121
121
Slide 122
122
Slide 123
123
Slide 124
124
Slide 125
125
Slide 126
126
Slide 127
127
Slide 128
128
Slide 129
129
Slide 130
130

About This Presentation

It contains all the necessary basics for Web Technologies Bachelors in technology notes


Slide Content

Mes

tess"moloe:,

WE ARE GOING TO DISCUSS...

COMMUNICATION ON THE WEB

WEB SERVER TECHNOLOGIES

WEB DESIGNING

STATIC AND DYNAMIC WEB PAGES

SCRIPTS AND TYPES OF SCRIPTING LANGUAGES
POPULAR SCRIPTING LANGUAGES

CASCADING STYLE SHEET

BASIC CONCEPTS OF HTML DOCUMENTS

We rely on different websites for
various purposes like.....

* Submitting online applications
* Viewing web contents

* Watching movies

* Banking transactions

* Purchase of goods through online
transaction and so on.

A website is a collection of web
pages.

A web page may contain texts,
graphics, sounds, animations, and
movies.

Web pages are developed with the
help of a language called
Hyper Text Markup Language(HTML).
It is also a language of Internet.

L1

8 (WM WornPress
Loma À E @
=“.

How is this website made available on
the Internet?

These web pages are to be stored in
web servers connected to the Internet,
to be made available to others.

Communication on web

a E, a "8
ENS a
AU 7
get Sc ee
AS

Communication on web

e.g., Browser e.g., Web Server

A very simplified view of web technology

Communication on web

The server sends
back the requested

Your local computer Server computer
wi Web browser software wi Web sarver software

In order to communicate on the web,
computers/devices need to understand each
other. This is made possible by making all devices
follow the same protocol, namely TCP/IP.

Communication on web

address

In order to communicate on the web,
computers/devices need to understand each
other. This is made possible by making all devices
follow the same protocol, namely TCP/IP.

Communication on web

E DMS Server
LA
z= >

e - y
= a

ce

Routing of a data packet from sender
toa us

>
ae i
| Router “3 Router — = |
Router

Router m) >
TCP breaks the data — reassembles the
into packets data packets back to
e e ein) form

The packets travel from
router to router over the
internet according to the IP

© a
aa y
DIAS

1P packets can take different row

In the Internet, there are several types
of communication.

« Websites are accessed using HTTP.
* Email communication happens using SMTP.

+ Internet Protocol provides the basics of
communication over Internet.

The role of routers in transporting
data in Internet

* The routers need not be programmed
separately to handle different types of data.

« They do not need to know about the data
they are transporting.

* lt concerned only about the address to which
the packet is to be delivered

* The openness of the data part of the packet gives
the freedom to design new protocols for the
Internet.

* This openness and flexibility of TCP/IP that led to
the development of protocols for
— social media websites to handle messages,
— content websites to handle video and audio,
— banking websites to handle money transfer securely, etc
* It is a deciding factor for the economic success of

the Internet.

Communication on the web can be
categorised as

1. Client (browser) to webserver

2. Web server to Web server communication

Y—U

Essential for Communication
over the Internet

1. Authentication : is the process of
determining whether a computer / server is
the computer that it claims to be.

2. Security : it should be provided to
communication over Internet so that the
messages are not intercepted and modified
by hackers.

1. Client (browser) to webserver

Web Server
e-3
Po |
J ey
OD

Pal
U =

1. Client (browser) to webserver

It does not usually require authentication.

But in the case of web based banking
applications / e-mail services, user names and
passwords are required to be sent to the
server.

This information cannot be sent to the server
in plain text due to security reasons.

The hackers may steal usernames and
passwords, if it is communicated and shared
as plain text.

1. Client (browser) to webserver

(1) User enters name and password

| Web Server [4]

Server
authorizes
e P access for
Client sends name and

© Server uses authenticated
password across network password to identity
authenticate

users identity

HTTPS
(Hyper Text Transfer Protocol Secure)

« HTTPS (Hyper Text Transfer Protocol Secure)
technology to encrypt the username and
password and then send it to the server.

It works using SSL (Secure Sockets Layer)

.

SSL (Secure Sockets Layer)

SSL provides a standard security technology for
establishing an encrypted connection between
computers on Internet.

It provides security capabilities to HTTP.

This protocol not only ensures privacy, but also
ensures that no other website can impersonate
the user's login account not alter the
information sent.

Verisign Inc. is a certification authority.

¡OS protected resource

Q [o
qs

O Accesses protected resource

Client-Server authentication process

. Browser requests to start a secure SSI session
2. Server returns its SSL certificate

3. Browser checks that : Certificate is valid,
signed by someone user trusts. If valid,
browser initiates and encrypted session

4. Server and Browser encrypts all the
transmitted data.

.

2. Web server to web server
communication

It may be required in certain web applications.

The web server of an online shopping website
needs to send confidential information to a
bank web server and vice versa.

In such cases the web servers of the merchant
and the bank are to be authenticated.

Digital certificates —
Payment gateway — a bridge

2. Web server to web server
communication dé

Request to gateway
Payment gateway

BE qu

to response

Merchant's
Web server

Request for
œ conformation

Server response

Bank
response

User placing
order

Merchant
bank account

Web server technologies

Web Server

www.dhsekerala.gov.in

Web server

* It is a server computer that hosts
websites

* It enables us to deliver web pages or
services like e-mail, blog etc., to users on
the Internet

* It consists of a server computer that runs
a server OS and a web software installed
on it for providing services over the
Internet

Web server

A

igi gt

* Itis a powerful computer which is always switched on
and connected to a high bandwidth Internet connection

* This will facilitate Internet users around the world to
access the websites and services hosted by it at any
point of time

+ It can have single or multiple processors, fast access
RAM, high performance hard disks, Ethernet cards that
supports fast communication

« It is usually installed in a data center to ensure faster
Internet connectivity and redundant power supply

Data center

It is a dedicated physical location where
organisations house their servers and networking
systems

It is used for storing, processing and serving
large amounts of mission-critical data to their
clients

It requires extensive backup power supply
systems, cooling systems, high speed networking
connections and security systems

Popular Server OS

Linux distributions

— Redhat, openSUSE, Debian, Ubuntu, etc)
Microsoft Windows Server

FreeBSD

Oracle Solaris etc.,

Web server software

* After setting up a server, a web server
software has to be installed in it and
configured according to the given OS

« The web server software is a program that
uses the client-server model and the HTTP to
ensure timely distribution of files stored in it
to the users

Some of the preferred
web server packages are

Apache Server

Microsoft Internet Information Server (IIS)
Google Web Server (GWS)

nginex (engine-x)

Other Software packages :
FTP, e-mail, DNS, databases etc

Hardware Ports

PR Kenn Corner $69 Mouse Carmector

* It is used to connect
external devices to the
computer

Vara Po

Pre
* These devices

ae communicate with the

ge ji computer using these

88 20 Pons pue ports

Eternal LAN Font

Software Ports

* It is used to connect a client computer to a
server to access its services like HTTP, FTP,
SMTP etc,

* To distinguish the ports, the software ports
are given unique numbers

* The purpose of software ports is to identify
different services like e-mail, file transfer
etc, running on a single server computer

Software Ports

* Port number is a 16-bit number which when
added to a computer’s IP address / URL, can
be used for communicating with a particular
service available on that server

* For example :

http://www.google.co.in:80

protocol Domain Port number
name

Some well-known ports and the
associated services

Default Port Service
Number
20 & 21 FTP
22 SSH
25 SMTP
53 DNS
80 HTTP
110 POP3

443 HTTPS

DNS Servers

It runs a special
purpose networking
software that
contains a database
of domain names
and IP addresses

DNS Servers

® ;
:
eo. -@ > a

a?

EN anycast instances :
ses ” dessen )

The DNS servers are arranged in a hierarchy.

At the top level there are 13 root servers that

contains name server information for all the generic

top-level domains

How the DNS resolves the IP address?

1.

2.

The browser first searches it local memory (mini
cache). If found, the browser uses it

If it is not found, it checks the OS’s local cache
for the IP address

If it is not found there, it searches the DNS
server of the local ISP

In the absence of the domain name in the ISP’s
DNS server, the ISP’s DNS server initiates a
recursive search

If found returns this IP address to the browser
and the webpage is displayed otherwise it
returns the message “Server not found” in the
browser window

How the DNS searches and locates
the IP address of a domain name?

Recursive DNS
search

ES
Ey

DNS

Operating System

Resolver

Your ISP

Web |
Browser

Client Program

Web-enabled Enterprises

Know your progress

. Name a protocol that works on top of the
Internet Protocol(IP)

- HTTP, SMTP
. Expand HTTPS
Hyper Text Transmission Protocol Secure
. What are the advantages of installing web
servers in data centers?

To ensure faster Internet connectivity and redundant
power supply, a webserver is usually installed in a data
center

Know your progress

4. State whether true or false

a. The web server software is a program that uses the
client-server model.

True

b. The web server consists of server OS and web server
software

True
5. The number of bits in a software port number is

16
6. A Domain Name System returns the
of a domain name
IP address

Know your progress

9. The social media websites developed their own
protocol for communicating over the Internet.
How is this possible when Internet uses TCP/IP
protocol?

— The openness of the data part of the packet gives the
freedom to design new protocols for the Internet.

— This openness and flexibility of TCP/IP that led to the
development of protocols for social media websites to
handle messages, content websites to handle video and
audio, and banking websites to handle money transfer
securely, etc

— It is a deciding factor for the economic success of the
Internet.

Know your progress

10.The username and password of e-mail account
has to be sent securely over the Internet
a. Name the technology used to send the data to the
server
HTTPS
b. How does this technology support secure data
communication?
HTTPS works using SSL (Secure Sockets Layer). SSL
provides a standard security technology for
establishing an encrypted connection between
computers on Internet.

Know your progress

11. ABC Engineering College has about 1000 computers
connected to the Internet, in its campus. What is
the advantage of having a local DNS server in the
college’s intranet?

This local DNS server contains a list of domain
names and their IP addresses which the users in the
organisation regularly access. This list can be
updated periodically to include new domain names.

Whenever a computer in the intranet tries to access
a website in the Internet, it first searches for the
domain name in the local DNS server and finds the
IP address. This speeds up the Internet access in the
organisation. Only if the domain name is not found
in the local DNS server, it searches the DNS of ISP

Know your progress
12.Write an example of a web server OS and a web
server package

Linux distributions (Redhat, openSUSE, Debian,
Ubuntu, etc)

Microsoft Windows Server
FreeBSD
Oracle Solaris etc.,
13.What is the use of software ports in a web
server?
To identify different services like e-mail, file
transfer, etc., running on a single server
computer.

Know your progress
13. The port used for HTTP is
80
14.Suppose you are browsing the website
www.prdkerala.org . Explain how DNS resolves
the IP address.

Recursive DNS
search _

Web | my
Browser ,

<> Operating System
Your ISP

Client Program

DNS

| Resolver

Web Designing

The first step in setting up a
website is planning the web pages
for the websites

Popular web designing softwares

Bluefish

— rra

sw] Adobe Dreamweaver

[ Microsoft Expression web

HTML

+ Hyper Text Markup Language

* It consists of tags and its attributes
used to format web pages

Static web pages

* Web pages that remain the same all
the time until their code is changed
manually.

* It is created using HTML.

Dynamic web pages

* The web pages that contain server side
code which creates a web page each
time it is accessed are called dynamic
web pages.

« Program code that runs on the server is
called server side code.

« Technologies like PHP, ASP, JSP, etc., are
used to develop dynamic web pages

Comparison of
static and dynamic web pages

Static web page

* The content and layout of
web page is fixed

* Itnever use databases

* It directly run on the
browser and do not require
any server side application
program

* These are easy to develop

Dynamic web page
* The content and layout may

change during run time

It uses the databases to
generate dynamic content
through queries

It runs on the server side
application program and
displays the results

* This web page development

requires programming skills

scripts

* These are program codes written inside HTML
page.

« They are written using a text editor like
notepad.

* Scripting languages like JavaScript, VB script,
PHP, Perl, etc., are used to create dynamic
web pages.

scripts

In an HTML page, a script is written inside <SCRIPT>
and </SCRIPT> tags.

<SCRIPT> is used to embed or refer to an executable
script within an HTML docment.

It has the attributes type and src.

Type attribute is used to identify the scripting
language code embedded within the script tag

Src attribute is used to specify the URL of an external
file containing scripting code to be linked to a web
page.

<SCRIPT type = “text/javascript” src =
“scriptcode.js”>

Types of scripting languages
1. Client Side scripting

2. Server Side scripting

Client Side scripting

It is used to perform any task at the client side
and is executed in the browser.

Since the script code is executed on the client
browser, it provides a quick response to the
users.

Disadvantage: there are browsers that do not
support scripts. In some cases users may turn
off the execution of scripts in the browser.

Eg. JavaScript, VB script

It is mostly used for validations and also for
performing simple calculations

Server Side scripting

* It is used to create dynamic web pages
and are executed in the server.

« Since the scripts are executed at the
sever, the type and version of the
browser or OS on the client’s computer
does not affect its execution.

« Eg. Perl, PHP, ASP, JSP etc.,

Working of server side scripts

Web Server
softwares

CLIENT
MySQL
Database

SERVER

Working of server side scripts

@ The web page containing server side
scripts requested by the user

Server side scripts which executes and
access the result from the database

ES) Creates simple web pages dynamically

This web page is then sent to the client
browser and the browser displays it

Comparison of the classifications of
scripting languages

Client side scripting

Script is copied to the client
browser and executed in the
client browser

Client side scripts are mainly
used for validation of data at
the client

Users can block client side
scripting

The type and version of the
web browser affects the
working of a client side script

Server side scripting

Script remains in the web
server and is executed in the
web server and the web page
produced is returned to the
client browser

Server side scripts are usually
used to connect to database
and return data from the web
server

Server side scripting cannot be
blocked by the user

The features of the web
browser does not affect the
working of server side script

Scripting Languages

* Some of the popular scripting languages
are given below:

JavaScript

VB Script

PHP (Hypertext PreProcessor)
ASP (Active Server Pages)

„arme

JSP (Java Server Pages)

1. JavaScript

It is a client side scripting
language used to make web
pages interactive

It was developed by
Brendan Eich while he was
working for Netscape
Communications
Corporation

It is implemented as an
interpreted language

Any text editor such as
Geany IDE, notepad etc, can
be used to write JavaScript
code

Javascript

JavaScript

It is popular as a client side scripting tool
and works in almost every browser

It can be inserted inside HTML code or can
be written as an external file and then
included inside HTML file

The extension name javaScript file is .js

It is a tool for validation of forms in the
client side and also be used for performing
simple calculations and also for bringing
animations to a web page

winx N”

Asynchronous Javascript And XML

* It is the technology used in JavaScript

+ Ajax is Asynchronous JavaScript and
Extensible Markup Language(XML) and
XML is a markup language which helps
users to create new tags

* It improves the interactivity of the
browsers

Advantage of using Ajax

1. After implementing Ajax on a website,
it does not require the entire page to
be reloaded for displaying dynamic
content on web pages

2. It allows web pages to be updated by
exchanging small amounts of data
between the client and the server
behind the scenes

Since Ajax relies more on JavaScript,
if the browser is not capable of
handling JavaScript or user has turned
off JavaScript functionality in the
browser, the Ajax application will not
work

3 Microsoft
2. VB Script VBScript

It is a scripting language developed by Microsoft
Corporation based on the popular programming
language Visual Basic.

It was developed to used either as a client side
scripting language for Microsoft IE or as a server
side scripting language with the Microsoft IIS.
Browsers other than IE may not be able to correctly
interpret and display the VB script code. Therefore it
is less popular as a client side scripting tool.

It is popular for server side scripting.
VBScript as a part of ASP.NET in .NET framework

ED 3PH Se

It stands for ‘PHP : Hypertext Pre-Processor’.
It is an open source general-purpose scripting
language that is suited for web development.
It can be embedded into HTML code.

It is a server side scripting tool and its code is
similar to Java, C and PERL.

Its main objective is to develop dynamic web
pages at ease.

PHP

PHP

* It was originally created
by Rasmus Lerdorf in
1994 but it is now
developed by The PHP
Group.

* The web page files that
contain PHP code have
the extension .php

PHP

+ PHP code is inserted inside HTML code and
when the user request for PHP web page, it is
interpreted and executed on the web server.

« One of the strongest and most significant
features in PHP is its support for database
programming.

* The most common database used with PHP is

MySQL. CD.

MySQL:

LAM ES

inux Apache MySOL PHP,Perl,Pyt

A) WampServer

Apache, PHP, MySQL on Windows

Both server softwares are freely downloadable.

AS Pes: 4, ASP

It is a server-side scripting environment that can
be used to create and run interactive web
applications.

It contains HTML and scripting languages
(VBScript, JavaScript).

ASP files have the extension .asp

These files are compiled using the Microsoft’s
web server software, IIS (Internet Information
Server).

It is executed only on Windows OS



a

This technology provides a simple and fast way to
create dynamic web content .

= Java 5. JSP

Server Pages

It is a server side scripting language that was
developed by Sun Microsystems in 1999 .

It is similar to PHP, but uses Java as programming
language

JSP files have the extension .jsp

To run JSP, Apache Tomcat web server is required.

It is an integral part of Java 2 Platform Enterprise
Edition (J2EE) .

CSS) Cascading Style Sheet (CSS)

* It is a style sheet language used for describing
the formatting of a document written in HTML.
Using CSS, we can control
— The colour of the text, S Ss
— The style of fonts,

Cascading Style Sheet
— The spacing between paragraphs,

— How columns are sized and laid out, borders and its
colours,

— What background images or colours are used, as
well as a variety of other effects in a web page.

CSS can be implemented in

three different ways

* Ininline style, the CSS style is applied to each
tag separately using the style attribute in the
body part of the web page.

« Embedded CSS codes are placed within the
<HEAD> part of the web page.

+ Linked CSS implementation is done using an
external file with the file extension .css that
contains only CSS code and is linked with the
web page.

Advantage of CSS

We can reuse the same code for all the pages.

Since CSS styles are written in a common place,
it separates CSS and HTML, which makes it
easy for maintenance.

It is easy to understand.

This also reduces the size of the web page
thereby providing faster downloads for web
pages.

Know your progress

1. The web pages that remain the same until their code is
changed manually are called
— Static web pages
2. Name two technologies that can be used to develop
dynamic web pages .
— JSP, PHP, ASP
3. The tag used to embed scriptsis______.
— <SCRIPT>......</SCRIPT>
4. Write any one of the uses of client side scripting.
Y It is used to perform any task at the client side
and is executed in the browser.
y Since the script code is executed on the client
browser, it provides a quick response to the
users.

Know your progress

5. A JavaScript file has the extension
N js
6. What is the advantage of using Ajax?

— After implementing Ajax on a website, it does not
require the entire page to be reloaded for displaying
dynamic content on web pages

— It allows web pages to be updated by exchanging
small amounts of data between the client and the
server behind the scenes

7. Classify the following scripting languages into client
side and server side.

JavaScript, PHP, ASP, VBScript
Client side : JavaScript
Server side : PHP, ASP, VBScript

Know your progress

8. .asp files are compiled using the web server
software ;
— WS (Internet Information Server)
9. List the different ways of implementing CSS
— In inline style, the CSS style is applied to each tag
separately using the style attribute in the body part of
the web page.
— Embedded CSS codes are placed within the <HEAD>
part of the web page.
— Linked CSS implementation is done using an external
file with the file extension .css that contains only CSS
code and is linked with the web page.

Know your progress

10.What are the advantages of CSS?
— We can reuse the same code for all the pages.

— Since CSS styles are written in a common place, it
separates CSS and HTML, which makes it easy for
maintenance.

— It is easy to understand.

— This also reduces the size of the web page
thereby providing faster downloads for web
pages.

HT

>

ML

Basic concepts of HTML documents

the most widely used language to write web
pages.

It is not a Programming Language.

It is not a Case Sensitive Language.

Each HTML file is a plain text that defines a set
of commands for creating hypertext

documents. These commands are known as
HTML tags.

HTML (Hyper Text Markup Language)

* Developed originally by
Tim Berners — Lee in 1980
at CERN, a European
Particle Physics Laboratory.

+ Now HTML standards are
controlled by W3C an
organisation founded in
1994.

<>
HTML
* The HTML files must be saved with .htm or
-html extensions.
« HTML pages are viewed with the help of a
software called Web Browsers.
« Popular Web Browsers are
— Microsoft Internet Explorer
— Mozilla Firefox
— Google Chrome
— Opera etc.,

TAGS

Tags are generally classified into
two types:

1. Container tag

2. Empty tag

Container tag or element

« This type of html tag or elements require pair
tags, ie., a starting tag as well as an ending tag.
« Examples :

<html>........ </html>
<head>......</head>
<title> ................</title>
<body>.......... </body>

Empty tag or element

« This type of html tag or elements require just a
starting tag and not an ending tag.
« Examples :

<br>
<frame>
<hr>

<img> etc.,

Attributes

An attribute is a special word used
inside the tag to specify additional
information such as colour, alignment,
background etc.,

Examples :

bgcolour, background, type, align etc.,

<>

HTML

Basic structure of HTML document

<html>
<head>

The Head
<title> </title>

</head>

<body>

The Body

</body>

</htmi>

>
mn Example of HTML document
<html>
<head>
<title> This is the title of web page </title>
</head>
<body>
Hello, Welcome to the world of web pages !
</body>
</html>

<html> tag

It indicates that the document begins with
<html> tag and ends with </html> tag.

DIR attribute :
It is used to indicate the document direction.
It can take two values “ltr” and “rtl”.

It specifies whether the language direction is
from left to right or right to left.

Example : <html dir = “Itr”>

<html> tag

* LANG attribute :

* It specifies the
language to be
used in the web

page.
« Example:
<html lang = “en” >

Code

|Language

English
French

| German

Italian
Greak

Spanish
Arabic
| Japanese

| Hindi

russian

<head> tag

.

It contains the head of an HTML document,
which holds information about the document
such as its title, scripts used, style definitions
etc.,

* It is also a container tag.

<title> tag

* It is also a container tag pair that contains
the title of the HTML document, which will
appear in the web browser’s title bar.

* The search engines uses the Title to
identify the page.

* It is used inside the tag pair
<head>..</head>

<body> tag

* It is also a container tag pair that specifies
the document body section.

* This part contains the content to be
displayed in the browser window.

* Some attributes of <body>..</body> tag

« Background, bgcolour, text, link, alink,
vlink, leftmargin, topmargin etc.,

background

It is an attribute of <body> tag.

It sets an image as background for the
documents body.

It makes the page more attractive.
General format :

<body background = “URL of the picture”>
Example:

<body background = “school.jpg”>

To set an image as background for a

web page.
<html>
<head>
<title> Background Image </title>
</head>

<body background = “school.jpg”>

<H1> BEM HIGHER SECONDARY SCHOOL PALAKKAD </H1>
</body>
</html>

bgcolor

It is an attribute of body tag.

It specifies a colour for the background of the
document body.

The value of bgcolor attribute can be given in
two ways: Color_name and Hex_number

Example :
<body bgcolor = “blue”>

text

It is an attribute of body tag.

It specifies the colour of the text content in the
page.

By default the browser displays the text in black
colour on a white or grey background.

The value of text attribute can be given in two
ways: Color_name and Hex_number

Example :
<body text = “red”> or <body text = “#ff0000”>

Link, alink and vlink

+ Ahyperlink is an element, a text or an image
that we can click on, and jump into another
document or another section of the same
document.

« Ahyperlink points to a whole document or to
a specific element within a document.

+ link, alink and vlink are attributes of body tag

Link : it specifies the colour of the hyperlinks
that are not visited by the viewer. The default
colour is blue.

Alink : it specifies the colour of the active
hyperlink. The link remains active only for the
moment the mouse is clicked on it. The default
colour is green.

Vlink : it specifies the colour of the hyperlink
which is already visited by the viewer. The
default colour is purple.

Leftmargin and Topmargin

+ Leftmargin : it is used to leave some blank area
on the left side of the document. The value is
specified in pixels.

* Topmargin : it is used to leave some blank area
at the top edge of the document window.

The value is specified in pixels.
« For example :
<body leftmargin = “60” topmargin = “70”>

Know your progress

1. HTML stands for A
— Hyper Text Markup Language.
2. What is container tag ?

— Tags that require opening tag as well as closing
tag are known as container tag.

— Eg. <html>...</html>

3. The type of tag that requires only a starting
tag but not an ending tag is called
— Empty tag

4. State true or false
— Tags are case sensitive.
— FALSE
— Bgcolor is an attribute of <BODY> tag.
— TRUE
— <TITLE> tag is an empty tag.
- FALSE
— Diris an attribute of <HEAD> tag.
FALSE
5. Name the attributes of <HTML> tag.
— Dir, Lang
— Eg. <html Dir=“Itr” Lang="en”>...</html>
6. What is the use of attributes in a tag?

— To provide additional information such as colour, measurement,
location, alignment or other appearances to the web browser.

7. List the different attributes of <BODY> tag.
— Bgcolor, background, text, topmargin, leftmargin, link, vlink, alink

Some common tags

« Used for formatting the text contents in the
body section of the HTML document and
therefore they are called formatting tags.

1. HEADING TAGS <H1> to <H6>
— Main attribute of this tag is align.

— The possible values are left, right, center.
— Eg. <H1 ALIGN = “LEFT”> HEADER-1 </H1>

2. Creating paragraphs - <P> tag

It indicates a new paragraph and instructs the
browser to add a blank line before the paragraph.

It is a container tag <P>........ </P>

Main attribute of this tag is align.

The possible values are left, right, center, justify.
Eg. <P ALIGN = “LEFT”> paragraph content </P>

3. Inserting line break - <BR> tag

It is used to break the current line of text and
continue from the beginning of the next line.

It is a empty tag <BR> i.e., no ending tag.

4. Creating horizontal line - <HR> tag

— It produces a horizontal line spread across the
width of the browser window.

— Itisa empty tag <HR>

— Main attribute of this tag is align, size, width,
color, noshade.

— The possible values for align attribute are left,
right, center.

— Eg. <HR SIZE = “10” WIDTH = “50%” ALIGN =
“CENTER” COLOR = “GOLD” NOSHADE >

5. Centring the content - <CENTER> tag

It brings the content to the centre of a web
page horizontally.

The content may be text, image, table etc.,

It is a container tag <CENTER> ...... </CENTER>
There is no attribute for this tag.

6. Text formatting tags

<B> - it sets the text style to bold. <B>....</B>
<I> - it sets the text style bold italics. <|>....</|>
<U> - it is used to underline a text in HTML.
<U>....</U>

<S> and <STRIKE> - it sets the text in strike
through style. <STRIKE>....</STRIKE>

<BIG> - it is used to make the content bigger in
size than the normal text size. <BIG>....</BIG>
<SMALL> - it is used to make the content
smaller in size than the normal text size.
<SMALL>....</SMALL>

<STRONG> - it is just the same as <B>
<STRONG>....</STRONG>

<EM> - it sets the text style italics. It is the same
as that of <I> <EM>....</EM>

<SUP> - it is used to create supscripts in a web
page. <SUP>....</SUP>

<SUB> - it is used to create subscripts in a web
page. <SUB>....</SUB>

<BLOCKQUOTES> and <Q> - it is used to indent
the content enclosed in these tags.
<BLOCKQUOTES>....</BLOCKQUOTES>

Know your progress

1. Name some of the text formatting tags.

<B>...</B>

<I>...</I>

<U>...</U>
<STRIKE>...</STRIKE>
<BIG>...</BIG>
<SMALL>...</SMALL>
<STRONG>...</STRONG>
<EM>...</EM>
<SUB>...</SUB>
<SUP>...</SUP>
<BLOCKQUOTE>...</BLOCKQUOTE>

2. List the different attributes of <HR> tag.
— SIZE, WIDTH, ALIGN, COLOR, NOSHADE
3. How many levels of heading tags are available
in HTML?
— Six levels
— <H1>..</H1>
— <H2>..</H2>
— <H3>..</H3>
— <H4>..</H4>
— <H5>..</H5>
— <H6>..</H6>

4. Write an HTML code segment to display X* + Y*.
— X<SUP> 3 </SUP> + Y <SUP> 3 </SUP>
5. State True or False.
— <BR> tag is an empty tag —
— TRUE
— <EM> and <I> tags have same usage in HTML document. —
— TRUE
— <U> and <I> tags are not allowed to be used together. —
— FALSE.
6. What is the use of <STRONG> tag?
— ¡it sets the text style Bold. It is the same as that of <B>
7. Pick the odd one out from the following
— HTML, ALIGN, HEAD, CENTER
— ALIGN

<PRE> - Displaying preformatted text

It is used to display the content as we entered
in the text editor.

It turn off the automatic formatting applied by
the browser.

It is a container tag.
<PRE> usó </PRE>

<ADDRESS> - Displaying the address

It defines the contact information for the
author / owner of document or an article.
Most of the browsers display the texts in
italics.

It is a container tag.

<ADDRESS>........... </ADDRESS>

<MARQUEE> - Displaying text in a
scrolling Marquee

* It displays a piece of text or image scrolling
horizontally or vertically in the web page.

* It is a container tag.<MARQUEE>...</MARQUEE>

* The list of important attributes of <MARQUEE>.

— HEIGHT, WIDTH, DIRECTION, BEHAVIOUR,
SCROLLDELAY, SCROLLAMOUNT, LOOP, BGCOLOR,
HSPACE, VSPACE

<DIV> - Formatting a block of text

* It is used for defining a section or a block in the
document.

* It is a container tag.<DIV>...</DIV>

* The list of important attributes of <DIV>.
— ALIGN, ID, STYLE

<FONT> - Specifying font
characteristics

* It allows us to change the size, style and colour
of the text enclosed within this tag.
* It is a container tag.<FONT>...</FONT>
* The list of important attributes of <FONT>.
— COLOR - it sets the text colour
— FACE - it specifies font face i.e., type

— SIZE - it specifies the font size whose values ranges
from 1 or 7, with default value 3.

HTML entities for reserved characters
* afew special characters and their equivalent entities.

&nbsp; Non Breaking Space
el &quot; Double quotation mark
© &apos; Single quotation mark
& &amp; Ampersand
< &lt; Less than
> &gt; Greater than
© &copy; Copyright Symbol
™ &trade Trademark Symbol

o &reg; Registered Symbol

Adding comments in HTML document

* HTML provides comment tag to insert
comments in the source code.

* HTML comments are placed within
<!-- --> tag.

* It will be completely ignored by the browser.

Inserting images
<IMG> tag is used to insert images in HTML pages.
It is an empty tag and it has many attributes.
SRC is the main attribute and it specifies the file
name of the image to be inserted.
Other attributes are WIDTH, HEIGHT, VSPACE,
HSPACE, ALIGN, BORDER, ALT
The possible values for ALIGN attribute are
BOTTOM, MIDDLE, TOP
<IMG SRC="book.jpg” HEIGHT="40” WIDTH ="60”
ALIGN = “BOTTOM” ALT=“Image of an opened
book”>

Know your progress
1. How are special characters represented in
HTML?
— HTML entites
2. Face attribute is used with tag.
— <FONT> TAG
3. List the attributes of <FONT> tag.
— FACE, SIZE, COLOR
4. What is the use of <PRE> tag?
— Itis used to display the content as we entered in the
text editor.
5. For scrolling a text, we use tag.
— <MARQUEE>

6. What are the main attributes of <MARQUEE>
tag?
— HEIGHT, WIDTH, DIRECTION, BEHAVIOUR,
SCROLLDELAY, SCROLLAMOUNT, LOOP, BGCOLOR,
HSPACE, VSPACE

7. What is the use of <ADDRESS> tag?

— It defines the contact information for the author /
owner of document or an article.

8. What is the normal font size in <FONT> tag?
- 3

9. Name the main attributes of <DIV> tag.
— ALIGN, ID, STYLE

10.To insert images in an HTML document

is used.
— <IMG> TAG
11. is the main attribute of <IMG> tag.
— SRC

12.What is the use of ALT attribute of <IMG> tag?
— To specify an alternate text for an image
13.Name the attributes that are used to display an
image in a particular size.
— WIDTH, HEIGHT
14.Which are the attributes that provides
horizontal and vertical spaces between two
images?
— HSPACE, VSPACE

15.Who developed HTML?.
— Tim Berners Lee
16.In HTML, there are mainly two sections. Can
you name them?
— Head section and Body section
17.The default colour of the attribute ALINK is ___
— GREEN
18.The default colour of the attribute VLINKis__
— PURPLE
19. Name the tag which has NOSHADE attribute.
— <HR> tag
20. The default alignment of an image obtained by
using <IMG> tag is _____
— BOTTOM
Tags