Understanding Web Document Types
Understanding Web Document Types
● Static
● Dynamic
● Active
Static Web Document
● Static web pages are also known as flat or stationary web page.
● It contain only static information.
● They are loaded to the client browser as exactly stored on the web server
● It is read [Link] do any modification
● It is creates using HTML and CSS
● Static web pages are only used when the information is no more required to be
modified.
Advantages of Static Web Page
● Time-Saving : Quick to develop
● Cost - Effective : Cheap to develop
● Inexpensive Hosting :Cheap to Host
● Easy Indexing :as they are coded in only Html or Css
● Fast Transferring :trasnfers from server to client without much
. processing time
Disadvantages of Static WebPage
● Difficult to Change
● Limited Functionality
● Easy to update
● Powerful Features
● Interactive
● Quick to Responsiveness
● Smooth Navigation
Disadvantages
● Higher Cost
● Slow Processing
Difference Between Static and Dynamic Website
Static Dynamic
● In static web pages, Pages will remain same until ● In dynamic web pages, Content of pages are different
someone changes it manually. for different visitors.
● Static Web Pages are simple in terms of complexity. ● Dynamic web pages are complicated.
● In static web pages, Information are change rarely ● In dynamic web page, Information are change
frequently.
● Static Web Page takes less time for loading than ● Dynamic web page takes more time for loading.
dynamic web page.
● In Static Web Pages, database is not used. ● In dynamic web pages, database is used.
● Static web pages are written in languages such as: ● Dynamic web pages are written in languages such as:
HTML, JavaScript, CSS, etc. CGI, AJAX, ASP, [Link], etc.
Active Web Page
● An active web document consists of a computer program that the server sends
to the browser and that the browser must run locally. When it runs,
the active document program can interact with the user and
● Eg:PHP,ASP,R,JSP etc.
Functionalities provided by Server side scripts
● Dynamic add and edit
● Response to user queries
● Access any Data or database
● Customize web page for individual users
● Provide security as server code cannot view on web browser
Advantages of server side scripting
● Reduces load on user’s computer
● Can create data driven application
● Dynamic website can easily be developed
● Server side scripting does not depends on browser processing as all
processing performs on server side
● As scripting is done on the server, it is not sent back to the browser,which
prevent it from being cloned,copied, or scrutinized for hacking vulnerabilities
● Loading time of web page is often reduced which helps to improve site
google ranking
Disadvantages
● Scripting puts increased demands on a website’s server. Websites using large
applications and with heavy traffic may need to utilize more powerful hosting
methods such as dedicated servers or cloud hosting to cope with demand.
● Server-side scripting requires pages to be refreshed in order to show the
dynamic content
● It requires a database to store the dynamic data
● It requires corresponding language interpreter be installed on the server
Client side Scripting
Client-side scripting is source code that is executed on the client's browser
instead of the web-server, and allows for the creation of faster and more
responsive web applications
Eg: HTML,CSS,
Javascript,VB script etc
Advantages and Disadvantages
Advantage:
● Since, there is no processing of data, so faster response is received.
Response time is way less than that of server side.
● It is the best way to make any alterations on the page without disturbing the
database settings.
Disadvantage:
● More development time and effort might be required
● Not all browsers support scripts, therefore, users might experience errors if no
alternatives have been provided.
Difference Between Client and server side scripting
BASIS FOR
COMPARISON SERVER-SIDE SCRIPTING CLIENT-SIDE SCRIPTING
Basic Works in the back end which could not be visible at Works at the front end and script are visible
the client end. among the users.
Execution Executed in the web server Executed in the Client side or web browser
Processing Requires server interaction. Does not need interaction with the server.
Languages involved PHP, [Link], Ruby on Rails, ColdFusion, Python, HTML, CSS, JavaScript, etc.
etc
Affect Could effectively customize the web pages and Can reduce the load to the server.
provide dynamic websites.
• An HTML element provides instruction to the browser,specifying how to display the HTML
document
For example, the <title> element represents the title of the document.
Most HTML elements are written with a start tag (or opening tag <>)
and an end tag (or closing tag </>), with content in between.
Elements can also contain attributes that defines its additional properties.
For example, a paragraph, which is represented by the p element, would be written as
<!DOCTYPE html>
HTML5 page structure <html>
An HTML document composed of <head>
Three sections <meta charset="UTF-8">
1. A line containing HTML document Type <title>Title of the
!DOCTYPE declaration:type and version document</title>
</head>
<html> ..Root element
2. A declarative header element <body>
3. A body, documents content <header>….</header>
<h1>……</h1>
<nav>….</nav>
<article>
<section>
….
</section>
</article>
<aside>…</aside>
<footer>…</footer>
</body>
</html>
The document's HEAD(HTML <head> Tag)
● The <head> tag contains metadata (document title, character set, styles, links, scripts), specific information
about the web page that is not displayed to the user. Metadata provides browsers and search engines with
technical information about the web page.
The <head> includes the following elements:
● The <title> tag defines the title of a web page.
● The <style> tag contains CSS code that defines how HTML elements should be rendered in a browser.
● The <base> tag defines an absolute (base) URL for all relative URLs.
● The <link> tag defines the relationship between the current HTML document and the resource to which it
refers, or contains a link to an external style sheet. It can have two attributes: rel="stylesheet" and "href".
● The <meta> tag provides additional information (metadata) about HTML document. The <head> of a page
can include different kinds of <meta> elements that may contain "name" and "content" attributes(this helps
google search engine hit).
● The <script> tag contains a script (generally JavaScript), or reference to an external file with [Link]
element may not be included in <head>. Sometimes, it is better to put it at the bottom of <body>. T
● The <noscript> tag defines an alternate text, which is displayed, if the browser doesn’t support scripts or
scripts are disabled by the user
The document’s Body
HTML5 introduces new structural tags, which are also called semantic tags because they
add more meaning to HTML code by better identifying each type of content they format.
Here are the new structural tags introduced in HTML5:
● <header> — Defines the header of any section or page. The header tag is the ideal
place for the name of the site.
● <nav> — Defines the main navigation links in a page or section. The main navigation
links are typically placed just after the header and then repeated at the bottom of the
page.
● <article> and <section> — Use these tags to define any article or a distinct section of a
page.
● <footer> — Defines the footer for any section or page. You can use the <footer> tag
within a section or article tag, but it’s most commonly used at the very bottom of a page.
Usually the footer has a lot of legal text in it.
The document’s Body(cont…)
● <aside> — Newly introduced in HTML [Link] allows to create a section that is
used display the information about the content of other elemnts,time and
date, weather report, current news etc
● <address> — The <address> tag defines the contact information for the
author/owner of a document or an article.
● The contact information can be an email address, URL, physical address,
phone number, social media handle, etc.
● The text in the <address> element usually renders in italic. Most browsers will
add a line break before and after the address element.
Types of HTML 5 Elements
● Structural Elements
● Metadata Elements
● Form Elements
● Formatting Elements
● List Elements
● Table Elements
● Scripting Elements
● Embedded Content Elements
Structural /semantic Elements
Group of elements that are used to organize page content to give the documents
more structure
Some examples are:
<header> — Defines the header of any section or page
<nav> — Defines the main navigation links
in a page or section
<footer> — Defines the footer for any section or page
<article> and <section> —define any article
or a distinct section of a page.
<aside>
<body>,<h1>…<h6>, <br>,<hr>
<div> division in document
<a> — Defines Hyperlink
<p> — defines paragraph
<body>,<head>
Metadata Elements
● Metadata is data (information ) about data.
● It provide additional information about the document.
● It is not displayed on the page
● Metadata elements are typically used to specify page
description,keywords,author of document, last modified etc.
● Example:
<base>
<link>
<meta>
<title>
<style>
Form Elements
● HTML form elements are used to capture user input.
● datalist, output, keygen, progress, and meter are new
form elements in HTML 5
● text box, check box, drop down, submit button
check box,radiobutton are commonly used form elements
Formatting Elements
● Elements used to format the text in HTML Page
List Elements
HTML offers web authors three ways for specifying lists of
information. All lists must contain one or more list
elements. Lists may contain −
<ul> −An unordered list. This will list items using plain
bullets.
<ol> −An ordered list. This will use different schemes of
numbers to list your items.
<dl> −A definition list. This arranges your items in the
same way as they are arranged in a dictionary.
Table Elements
The table element represents a table. These allow authors to represent tabular data in a document. In
the code, a table basically consists of a group of rows that contain, each, a group of cells.
● A table element acts only as a container where other elements can be declared. These elements
are:
● caption: provides a title for the table.
● colgroup: groups columns thematically.
● col: applies common attributes and styles to one or more columns.
It can only be declared as child of colgroup.
● tbody: represents the body section of a table.
● thead: represents the header section of a table.
● tfoot: represents the footer section of a table.
● tr: represents a row. It can be declared as child of tbody, thead, tfoot or table.
● td: represents a data cell. It can only be declared as child of tr.
● th: represents a header cell. It can only be declared as child of tr.
Scripting Elements
● It is used to add or reference executable code ,typically javascript
● The <script> tag is used to define a client-side script (JavaScript).
● The <script> element either contains scripting statements, or it points to an
external script file through the src attribute.
● The <noscript> tag defines an alternate content for users that have disabled
scripts in their browser or have a browser that doesn't support script
Embedded content Elements
● The embedded content element can be used to embed external application,
typically multimedia content like audio or video into an HTML document
● Eg: <img>,<iframe>,<canvas>,<map><source>,<figure>
● New Media Elements added in HTML5
HTML 5 Attributes Types
HTML Tag Attributes are modifiers for the HTML tags and they provide additional
information. In most cases they are defined in name="value" pairs and they are always
declared in the opening tag.
Eg: <img src="[Link]" width="200" height="200" />
HTML attributes are generally categorised as
● Required attributes or Optional attributes
● Standard or global attributes
● Event attributes
Required/Optional Attributes
They are the element specific attributes that defines additional properties of an
element
Attribute Belongs to Description
Eg: - href <a>,<area> Specifies the URL of the page the link goes to
,<base>,<link>
src <img>,<iframe>, Specifies the URL of the media file
<input>,<script>
<video>,<audio>
colspan <td>,<th> Specifies the number of columns a table cell should
span
rowspan <td>,<th> Specifies the number of rows a table cell should span
form <button>,<input>... Specifies the name of the form the element belongs to
controls <video>,<audio> Specifies that audio/video controls
muted <video>,<audio> Audio output shoud be muted
Standard/Global Attributes
These are the common to all element (<base>,< tilte>,< script> are exceptions)
Eg: -
Attribute Value Description
class Classname Specifies the class name of the element
● CSS handles the look and feel part of a web page. Using CSS, you can control the color of the text,
the style of fonts, the spacing between paragraphs, how columns are sized and laid out, what
background images or colors are used, as well as a variety of other effects.
● CSS is easy to learn and understand and it provides powerful control over the presentation of an
HTML document. Most commonly, CSS is combined with the markup languages HTML or XHTML
Selector −A selector is an HTML tag at which a style will be applied. Eg: h1,p etc
Value −Values are assigned to properties. For example, color property can have value
either red or #F1F1F1 etc.
Applying CSS to HTML
There are three ways to inserting a style sheet
● Inline style
Affects only the element where applied
● Use it when you need to format just a single section in a web page
● Syntax:
• Use it when you need to control the style for an entire web site
• Syntax:
<head>
Types of selectors
* Universal Selector
* Element selectors
* Class Selectors
* ID Selectors
* Grouping Selectors
Universal selector
● The universal selector (*) selects all HTML elements on the page.
● Example
The CSS rule below will affect every HTML element on the page:
*{
text-align: center;
color: red;
}
Element Type Selector
● The element selector selects HTML elements based on the element name.
● Example
Here, all <p> elements on the page will be center-aligned, with a red text color:
CSS provides the several properties for styling and formatting the most commonly used unordered and
ordered lists. These CSS list properties typically allow you to:
● Control the shape or appearance of the marker.
● Specify an image for the marker rather than a bullet point or number.
● Set the distance between a marker and the text in the list.
● Specify whether the marker would appear inside or outside of the box containing the list items.
Styling lists with CSS
Five CSS properties to control list are: