Unit 2 - 2.1 Static Web Pages
Unit 2 - 2.1 Static Web Pages
2
STATIC AND DYNAMIC WEB
PAGES,STYLE SHEETS AND WEB
PUBLISHING
• Website: A collection of web pages which are grouped together and usually
connected together in various ways. Often called a "website" or a "site."
• Search engine: A web service that helps you find other web pages, such as
Google, Bing, Yahoo, or DuckDuckGo. Search engines are normally accessed
through a web browser (e.g. you can perform search engine searches directly
in the address bar of Firefox, Chrome, etc.) or through a web page (e.g.
bing.com or duckduckgo.com
A public library. This is what you would
generally do when visiting a library:
1.Find a search index and look for the title of the book you
want.
2.Make a note of the catalog number of the book.
3.Go to the particular section containing the book, find the
right catalog number, and get the book.
A public library. This is what you would
generally do when visiting a library:
•The library is like a web server. It has several sections, which is
similar to a web server hosting multiple websites.
•The different sections (science, math, history, etc.) in the library are
like websites. Each section is like a unique website (two sections do
not contain the same books).
•The books in each section are like webpages. One website may have
several webpages, e.g., the Science section (the website) will have
books on heat, sound, thermodynamics, statics, etc. (the webpages).
Webpages can each be found at a unique location (URL).
•The search index is like the search engine. Each book has its own
unique location in the library (two books cannot be kept at the same
place) which is specified by the catalog number.
Webpage
• Web page :
A web page is a simple document displayable by a browser. Such documents are
written in the HTML language (which we look into in more detail in other
articles). A web page can embed a variety of different types of resources such as:
All web pages available on the web are reachable through a unique address.
Website
• Website:
A website is a collection of linked web pages (plus their associated
resources) that share a unique domain name. Each web page of a
given website provides explicit links—most of the time in the form
of clickable portions of text—that allow the user to move from one
page of the website to another.
• Web server:
A web server is a computer hosting one or more websites. "Hosting" means that
all the web pages and their supporting files are available on that computer. The
web server will send any web page from the website it is hosting to any user's
browser, per user request.
Don't confuse websites and web servers. For example, if you hear someone say,
"My website is not responding", it actually means that the web server is not
responding and therefore the website is not available. More importantly, since a
web server can host multiple websites, the term web server is never used to
designate a website, as it could cause great confusion. In our previous example,
if we said, "My web server is not responding", it means that multiple websites on
that web server are not available.
Search engine?
• Search engine:
Search engines are a common source of confusion on the web. A
search engine is a special kind of website that helps users find web
pages from other websites.
There are plenty out there: Google, Bing, Yandex, DuckDuckGo, and
many more. Some are generic, some are specialized about certain
topics. Use whichever you prefer.
A web page containing HTML, CSS and Javascript (basically just using
client –side languages to design a website )
20-Jun-23
What is a static website?
• A static website is made up of web pages created using
HTML, CSS and Javascript (all examples of web
development languages).
• Any Site that has fixed content usually written in html
code.
• Each page on a static website is stored as a single HTML
file, which is delivered directly from the server to the
web page exactly as is.
• This content essentially becomes a part of the design on
your page, and won’t change unless the original HTML
file is edited at a code level.
What is a static website?
DYNAMIC WEBSITE
Header ( Logo, Menu Bar, icons )
WEBSITE STRUCTURE
What is a Dynamic Website?
• Built using server side language and technology, dynamic
websites allow for the content of each page to be delivered
and displayed dynamically, or on-the-fly, according to user
behavior or from user-generated content.
Advantages
(Pros) Disadvantages (Cons)
1. Much more functional website 1. More expensive to develop
2. Much easier to update 2. Slower to develop
3. Much Easier to add new content/pages 3. Hosting costs a little more ( This might not be
true now, because of great shared web
4. New content brings people back to the site and hosting plans these days)
helps in the search engines
5. Can work as a system to allow staff or users to
collaborate
A DYNAMIC WEBSITE STRUCTURE
http://spudniksavannah.com/#home
EXAMPLES OF INTERACTIVE WEBSITES DONE IN ADOBE MUSE
http://www.grupoimark.com/#home
EXAMPLES OF INTERACTIVE WEBSITES DONE IN ADOBE MUSE
http://www.whoismrh.com/index.html
Static Web Page
20-Jun-23
INTRODUCTION OF HTML
It is simply a collection of certain key words called ‘Tags’ that are helpful in writing the document to be displayed
using a browser on Internet.It is a platform independent language that can be used on any platform
makes decision about presentation (how the parts look) of the document.
• HTML also provides tags to make the document look attractive using graphics, font size and colors.
User can make a link to the other document or the different section of the same document
OBJECTIVE OF HTML
a) HTML Editor: it is the program that one uses to create and save HTML
- Text based or code based which allows one to see the HTML code as one is
- Netscape composer
HTML TOOLS
b) Web Browser: it is the program that one uses to view and test the
HTML documents. They translate Html encoded files into
text,image,sounds and other features user see. Microsoft Internet
Explorer,Netscape,Mosaic Chrome are examples of browsers that
enables user to view text and images and many more other World
Wide Web featueres.They are software that must be installed on user
computer.
HTML TERMINOLGY
a)Tag: Tags are always written within angles brackets. it is a piece of text is used to identify an element so
that the browser realizes how to display its contents.e.g.<HTML> tag indicates the start of an HTML
-Paired Tags :A tag is said to be a paired tag if text is placed between a tag and its companions tag.In
paired tag ,the first tag is referred to as opening tag and the second tag is referred to as closing tag.
-Unpaired Tags: An unpaired tag does not have a companion tag .unpaired tag also known as singular or
b) Attribute: Attribute is the property of an tag that specified in the opening angle brackets. It
supplies additional information like color,size,home font-style etc to the browser about a tag.
Markup Language(SGML).HTML is define in terms of its DTDS. All the details of HTML tags,
or a list. It can include an opening and a closing tag and the contents within it.
HOW TO CREATE AN HTML DOCUMENT
The essential tags that are required to create a HTML document are:
<HTML>.............</HTML>
<HEAD>.............</HEAD>
<BODY>.............</BODY>
HTML Tag <HTML>
The <HTML> tag encloses all other HTML tags and associated text
within your document. It is an optional tag. You can create an HTML
document that omits these tags, and your browser can still read it and
display it. But it is always a good form to include the start and stop
tags.The format is:
<HTML>
Your Title and Document (contains text with HTML tags) goes here
</HTML>
Most HTML tags have two parts, an opening tag and closing tag. The
closing tag is the same as the opening tag, except for the slash
mark e.g. </HTML>. The slash mark is always used in closing tags.
An HTML document has two distinct parts HEAD and BODY
<HTML>
<HEAD>
.............
.............
.............
</HEAD>
<BODY>
.............
.............
.............
</BODY>
</HTML>
HEAD Tag <HEAD>
HEAD tag comes after the HTML start tag. It contains TITLE tag to give the document a title
that displays on the browsers title bar at the top. The Format is:
<HEAD>
<TITLE>
</TITLE>
</HEAD>
BODY Tag <BODY>
The BODY tag contains all the text and graphics of the document with all the
HTML tags that are used for control and formatting of the page.The Format is:
<BODY>
Your Document goes here
</BODY>
MARGINS: set the left hand/right hand margin of the document LEFTMARGIN: set the left
hand margin of the document Example:
<BODY LEFTMARGIN="60">
This document is indented 60 pixels from the left hand side
of the page.
</BODY>
TOPMARGIN: set the left hand margin of the document Example:
<BODY TOPMARGIN="60">
This document is indented 60 pixels from the top of the page.
</BODY>
Attributes used with <BODY>
Step-3: Save the file as myfirstpage.html (go to File-Save As give File name:
By using <FONT> Tag one can specify the colors, size of the text. Example:
- COLOR: Sets the color of the text that will appear on the
screen. It can be set by giving the value as #rr0000 for red (in RGB hexadecimal format), or by
SIZE: Sets the size of the text, takes value between 1 and 7, default is 3. Size can also be set
for example; SIZE=+X, where X is any integer value and it will add with the default size.
Example:
FACE: Sets the normal font type, provided it is installed on the user’s machine.
Example:
It is a Network of Networks
MARQUEE TAG
This tag is used text horizontally across the screen.it is mainly used
to deliver a specfic message to the visitor or to scroll Ads on a page.
Example: <marquee> hello world></marquee>
Attributes of marquee tag
Bgcolor : Sets the background color of the marquee.
Direction :Sets the direction of the marquee box to
either left-to-right, right-to-left, up-to-down
and down-to-up.
Width: This sets how wide the marquee should be.
Loop: This sets how many times the marquee should
'Loop' its text. Each trip counts as one loop.
paragraph Formatting Tag
<HTML>
<HEAD>
<TITLE>
Use of Paragraph, Line break and preformatted text Tag
</TITLE>
</HEAD>
<BODY>
HTML Tutorial
<P>
HTML stands for Hypertext Markup Language
It is used for creating web page. It is very simple
and easy to learn.
An HTML document control.html shows the use of <P>,
<BR> and <PRE>
</P>
<P>
HTML stands for Hypertext Markup Language.<BR>
It is used for creating web page. It is very simple<BR>
and easy to learn.<BR>
</P>
<PRE>
HTML stands for Hypertext Markup Language
It is used for creating web page. It is very simple
and easy to learn.
</PRE>
</BODY>
</HTML>
OUTPUT
HTML Tutorial
HTML stands for Hypertext Markup Language. It is used for creating
web page. It is very simple and easy to learn.
Link to a document called form.html on the same server in the same directory:
<a href="../parent.html">Parent</a>
Link to a document called cat.html on the same server in the subdirectory
stuff:
<a href="stuff/cat.html">Catalog</a>
77
Inserting an image with <img> tag:
<img src="/img/basd-logo.png">
mage attributes:
src Location of image file (relative or absolute)
alt Substitute text for display (e.g. in text mode)
height Number of pixels of the height
width Number of pixels of the width
border Size of border, 0 for no border
55
ORDERED LISTS: <OL> TAG
1. Apple i. Apple
2. Orange ii. Orange
3. Grapefruit Grapefruit
a. Apple
b. Orange iii.
A. Apple
B. Orange Apple
I.
C. Grapefruit c. Orange
Grapefruit
Grapefruit II.
<ul type="disk">
<li>Apple</li>
<li>Orange</li>
<li>Grapefruit<
/li>
</ul>
84
<table cellspacing="0"
<tr>
cellpadding="5">
<td><img src="ppt.gif"></td>
<td><a href="lecture1.ppt">Lecture
1</a></td>
</tr>
<tr>
<td><img src="ppt.gif"></td>
<td><a href="lecture2.ppt">Lecture
2</a></td>
</tr>
<tr>
<td><img src="zip.gif"></td>
<td><a href="lecture2-
demos.zip"> Lecture 2 -
Demos</a></td>
</tr>
SIMPLE HTML TABLES – EXAMPLE
</table>
85
<table cellspacing="0"
cellpadding="5">
<tr>
<td><img src="ppt.gif"></td>
<td><a
href="lecture1.ppt">Lecture
1</a></td>
</tr>
<tr>
<td><img
src="ppt.gif"></td>
<td><a
href="lecture2.ppt">Lecture
2</a></td>
</tr>
<tr>
<td><img
src="zip.gif"></td> 73
<td><a href="lecture2-
▶ Table rows split into three semantic sections: header,
body and footer
74
table-full.html
<table> By default, header text
<colgroup
is bold and centered.
> <col style="width:200px" /><col
/>
</colgroup>
<thead>
<tr><th>Column 1</th><th>Column h></
2</t tr>
</thead>
<tfoot>
<tr><td>Footer 1</td><td>Footer d></
2</t tr>
<tbody
</tfoot> Although the footer is
> <tr><td>Cell 1.1</td><td>Cell
1.2</td></tr> before the data in the
<tr><td>Cell 2.1</td><td>Cell
</2.2</td></tr> code, it is displayed last 76
<table> nested-tables.html
<tr>
<td>Contact:</td>
<td>
<table> ▶ Table data “cells”
<tr> (<td>) can contain
<td>First Name</td> nested tables
<td>Last Name</td> (tables within
</tr> tables):
</table>
</td>
</tr>
</table>
NESTED TABLES
77
▶ Tables have two important
attributes:
◆ cellspacin ◆ cellpaddin
g g
cell cell cell cell
◆ Defines the
empty space ◆ Defines the empty space
between cells around the cell content
body>
CELL SPACING AND PADDING – EXAMPLE (2)
table-cells.html
<html>
<head><title>Table Cells</title></head>
<body>
<table cellspacing="15" cellpadding="0">
<tr><td>First</td>
<td>Second</td></tr>
</table>
<br/>
<table cellspacing="0" cellpadding="10">
<tr><td>First</td><td>Second</td></tr>
</table>
</ 80
78
body>
▶ Forms are the primary method for gathering data from site
visitors
▶
▶ Create a form block with
<form></form>
Example:
The “method" attribute tells how
the form data should be sent –
HTML
via GET or POST request
FORMS <form name="myForm"
method="post"
action="path/to/some-
script.php">
... The "action" attribute tells where
</form>
the form data should be sent
▶ Single-line text input
fields: <input type="text" name="FirstName"
value="This is a text field" />
▶ Multi-line textarea fields:
<textarea name="Comments">This is a multi-line
text field</textarea>
▶ Hidden fields contain data not shown to the
user: <input type="hidden" name="Account"
value="This is a hidden text field" />
▶ Often used by JavaScript
code
FORM FIELDS
FIELDSETS
fields <form method="post"
: action="form.aspx">
<fieldset>
<legend>Client Details</legend>
<input type="text" id="Name" />
<input type="text" id="Phone" />
</fieldset>
<fieldset>
<legend>Order Details</legend>
<input type="text" id="Quantity"
/>
<textarea cols="40" rows="10"
id="Remarks"></
textarea>
</fieldset>
</form>
▶ Fieldsets are used to enclose a group of related form
FORM INPUT CONTROLS
<input type="checkbox"
Checkboxes name="fruit" value="apple" />
:
<input type="radio" name="title" value="Mr."
▶ Radio buttons:/>
▶ Radio buttons can be grouped, allowing
only one to be selected from a group:
<input type="radio" name="city" value="Lom"
/>
<input type="radio" name="city"
value="Ruse" />
OTHER FORM CONTROLS
▶ Dropdown <select
menus: <option value="Value 1"
name="gender">
selected="selected">Male</opti
on>
<option value="Value
2">Female</option>
<option value="Value
3">Other</option>
<input type="submit"
</select>
name="submitBtn" value="Apply
▶ Submit button:Now" />
▶ Reset button – brings the form to its
initial state
<input type="reset"
name="resetBtn" value="Reset
the –form"
▶ Image button /> submit but image is
acts like
displayed and click coordinates are sent
<input type="image" src="submit.gif"
name="submitBtn" alt="Submit" />
▶ Ordinary button – used for Javascript, no
default action
<input type="button" value="click me" />
93
form.html <form method="post" action="apply-now.php">
<input name="subject" type="hidden"
value="Class" />
<fieldset><legend>Academic information</legend>
<label for="degree">Degree</label>
<select name="degree" id="degree">
<option value="BA">Bachelor of Art</option>
<option value="BS">Bachelor of
Science</option>
<option value="MBA"
selected="selected">Master of Business
Administration</option>
</select>
<br />
<label for="studentid">Student ID</label>
<input type="password" name="studentid" />
</fieldset>
<fieldset><legend>Personal Details</legend>
<label for="fname">First Name</label>
<input type="text" name="fname" id="fname" />
<br />
HTML FORMS – EXAMPLE
<label for="lname">Last Name</label>
<input type="text" name="lname" id="lname" />
94
HTML FORMS – EXAMPLE (2)
form.html (continued)
<br />
Gender
:
<input name="gender" type="radio" value="m />
id="gm" "
<label for="gm">Male</label>
<input name="gender" type="radio" value="f />
<br /> id="gf" "
<label for="email">Email</label>
<label for="gf">Female</label>
<input type="text" name="email" id="email" />
</fieldset>
<p>
<textarea name="terms" cols="30" rows="4"
readonly="readonly">TERMS AND
CONDITIONS...</textarea>
</p>
<p>
<input
<inputtype="submit"
type="reset" name="submit"
value="Clear value="Send 95
Form" />
form.html (continued)
• Easy to use
• Loose syntax (although, being too flexible will not comply with
standards).
• Supported on almost every browser, if not all browsers.
• Widely used; established on almost every website, if not all
websites.
• Very similar to XML syntax, which is increasingly used for data
storage.
• Free - You need not buy any software.
• Easy to learn & code even for novice programmers.
78
DISADVANTAGES OF HTML
• User Sessions: Cookies are often used to maintain user sessions, allowing
websites to remember user data, preferences, and login status across
multiple pages or visits.
• Tracking: They are used for tracking user behaviour on websites,
collecting data on which pages are visited and how users interact with the
site.
• Personalization: Cookies enable websites to offer personalized experiences
by remembering user preferences, such as language settings, shopping
carts, and customized content recommendations.
Cookies Management
Features:
• Persistence: Cookies can be persistent or session-based, which will be dependent on the
time duration of data to last.
• Key-Value Storage: Cookies stores data in a key-value pair and the key-value pair
makes it easy to retrieve and update data.
• Security: Cookies can have security features like HttpOnly and Secure attributes to
protect against unauthorized access.
Benefits:
• User Convenience: Cookies mainly enhance user experience by storing user preferences
like language settings, shopping cart items, etc.
• Tracking: Cookies are used as trackers to collect user’s behaviour which will be helpful
for marketing strategies, improving content, etc.
• Authentication: Cookies are essential for maintaining the user’s session and
authentication to stay logged in.
Session Management
Session management refers to the process of securely handling
multiple requests to a web-based application or service from a
single user or entity. Websites and browsers use HTTP to
communicate, and a session is a series of HTTP requests and
transactions initiated by the same user.
src
⚫ This attribute is used to give the file name that should be loaded in the
frame. Its value can be any URL. For example, src="/html/top_frame.htm"
will load an HTML file available in html directory.
name
⚫ This attribute allows you to give a name to a frame. It is used to indicate
which frame a document should be loaded into.This is especially important
when you want to create links in one frame that load pages into an another
frame, in which case the second frame needs a name to identify itself as the
target of the link.
frameborder
⚫ This attribute specifies whether or not the borders of that frame are shown; it
overrides the value given in the frameborder attribute on the <frameset> tag
if one is given, and this can take values either 1 yes or 0 no.
marginwidth
⚫ This attribute allows you to specify the width of the space between the left and right of the
frame's borders and the frame's content. The value is given in pixels. For example
marginwidth="10".
marginheight
⚫ This attribute allows you to specify the height of the space between the top and
bottom of the frame's borders and its contents.The value is given in pixels. For
example marginheight="10".
noresize
⚫ By default you can resize any frame by clicking and dragging on the borders of a frame.The
noresize attribute prevents a user from being able to resize the frame. For example
noresize="noresize".
What are the 2 types of multimedia in HTML?
Media Tags:
Media Tag Description
<audio> An inline element is used to embed sound files into a web page.
<video> Used to embed video files into a web page.
<source> Used to attach multimedia files like audio, video, and pictures.
<embed> Used for embedding external applications, generally multimedia
content like audio or video, into an HTML document. <
<track> Specifies text tracks for media components, specifically for audio and
video elements.
Media Tags:
Table of Content
<audio> Tag
<video>
Adding youtube videos
<embed>
<source>
<track>
<audio> Tag:
It is a useful tag if you want to add audio such as songs, or any sound files into your webpage.
Syntax:
<audio>
<source src="sample.mp3" type="audio/mpeg">
</audio>
Example : In this example, we will use <audio> tag with an example.
Thank
You.
20-Jun-23