Hasini Thamarasa
Software Engineer
What is Internet
Has unlimited no of services
What is Network
ISP - Internet Service Provider ????
Information Retrieval System ????
Filter relevant information from collection of information
IR Resources : Web Search Engines , Websites ,e-books,reports
1.Communication
Similar to mailing letters in the Internet
Standard for Electronic Mail
Pictures,Files can be sent as attachments
Can be cc-ed or bcc-ed to multiple addresses
Fast,Cheap & Easy
Asynchronous method of Communication (Participants don't have to be online)
2.Data transfer
File Sharing
Copies files from one location to another via Internet
Use FTP - File Transfer Protocol
3. World Wide Web
Term Internet is not equal to WWW
WWW is only one of hundreds of services used on Internet
Basically shares documents,images
Use HTTP - Hypertext Transfer Protocol
4.Distributed and Cloud Computing
Internet is big revolution for the society
There is a huge impact in following key areas
*eGovernment is the application of ICT to improve the effectiveness and efficiency of government services
*Digital interaction between
government to governments (G2G)
government to citizens (G2C)
government to employees(G2E)
government to businesses (G2B)
Informational Services
Interactive Services
Transactional Services
Integrated Services
classification is determined by the maturity of the initiative
Informational Services
Interactive Services
Transactional Services
Integrated Services
Rating schemes like Network Readiness Index & e-Readiness Ranking have been proposed to rate the potential for countries to exploit the opportunities offered by ICT..
Business that is conducted over the Internet using any of the applications that rely on the Internet (e-mail,shopping carts,web services)
Online transaction
Buying and Selling
eCommerce is used in both non-profit and for-profit organizations
E-Commerce ???
the activity of buying and selling products & services on the web
Classification By Participant
Business to Consumer(B2C) - a company which sells goods to individuals
Business to Business(B2B) - a business selling goods or services to another company or nonprofit organization
Business to Government(B2G) - a company which sells goods to government agencies
Consumer to Consumer (C2C) -Consumers dealing with consumers in an online auction
Classification By Activities
E Learning
Eg: Video tutorial,e books,forums
Early Years of the Internet..
LAN
m i n i c o m p u t e r
LAN1
LAN
LAN3
LAN2
LAN5
LAN6
LAN7
WAN
Late 1960s
In 1960s
In 1970s
~Local Area Network
~Interconnected computer systems within limited area
~Emerged because of:
~Can share hardware resources and software resources
~Hard to interconnect different LANs with different technologies
Eg : Network in human resource division in a company
~Wide Area Network
~Network - covers relatively large geographical area
~Emerged for reducing LAN's problems
Eg: A bank network with branches all over the country
~Problems with sharing resources and compatibility with different technologies
~Wide Area Network (WAN) in ARPA to support US military operations
~ARPA - Advanced Research Project Agency
~Called backbone network
~Allows small networks to connect
~ARPA found a way to interconnect all machines from a large organization
Internet standards makes this possible
Has two pieces
Formally called as "The TCP/IP Internet Protocol Suite"
Actually this consists two Protocols
TCP/IP work as unified system at the same time cooperately
Set of rules (Agreement) for transmitting data between two devices
A protocol in which messages are divided into packets before they are sent over the Internet
Each packet is transmitted individually
Multiple computers can transmit data without delay
Msg1
IP address of the Source
IP address of the destination
Data Packet Labling
routing table
Checks for the
Eg : 172.20.10.85
2.233.209.35
Internet protocol Version 4 (IPv4)
32
Number format of dotted decimal notation
Everybody in Local Network
Same computer
Internet protocol Version 6 (IPv6)
consists of 128 bits
address space provides the potential for a maximum of 2
eg:FE80:0000:0000:0000:0202:B3FF:FE1E:8329
128
IP address Classification..
can be classified as unicast,multicast,anycast,broadcast
unicast - available in both IPv4 and IPv6
unicast address is associated with a single device or host
multicast - available in both IPv4 and IPv6
information is addressed to a group of destination computers simultaneously
broadcast - only IPv4 is available
refers to a method of transferring a message to all recipients simultaneously
Assigning IP address..
Static IP Address - assigned to a host permanently by fixed configuration of its hardware or software
Dynamic IP Address - assigned to a host at the time of booting
Public IP Address..
IPv4 and IPv6 define address ranges that are reserved for private networks and link-local addressing
Meaningfull alphabetic unique name for IP address
Format is
Eg : www.vle.bit.lk
hostname
subDomain
TLD
In Internet communication must use IP address to send or receive datagrams
DNS is a service to translate domain name into an IP address
DNS stores information associated with domain names
The Internet Corporation for Assigned Names and Numbers
ICANN is the authority coordinates the assignment of unique identifiers on the Internet
ICANN Scope
domain names,IP address,Protocol Port,Parameters
Back to History.........
ARPANET
NSFNET
In 1986
NSF (National Science Foundation) decided to fund Internet growth and TCP/IP technology and funded NSFNET as a cross country 56Kbps backbone
ARPANET was dissolved in 1990
MiniCom
LAN
WAN
ARPANET
Series of reports
Project Documentation
describe the internet
describe the TCP/IP it uses
rapid communication among the researchers
researchers to coordinate their activities
In 1960
Late 1960
In 1970
Late 1970
In 1983
In 1982
a prototype Internet was in place & the TCP/IP technology had been tested
U.S. military also started to use TCP/IP & chose the internet as its primary computer
communication system
ARPA expanded the Internet to include all military sites connected to the ARPANET
Transfer experiment to useful network
In 1986
FUNDED NSFNET
In 1990
DISSOLVED ARPANET
Simply, requester of services
This can be a process ,application,computer or a workstation
Eg: e-mail client
Simply, provider of services
This can be a powerful computer,device or a process on a network
Eg: printer server, e mail server
OS crash on server running machine
Servers must always be ready to receive requests..
Sometimes servers become unresposive
Loses power to server computer or ...
Format is 4XX
Eg : 404 - File Not Found
Format is 5XX
Eg : 500 - Internal Server Error , 503 - Service Unavailable
For connecting with friends - Social Networking
Any individual may use Internet is called a user
For getting information related to academic and professional topics
Eg : Children,Student,Teachers,Researchers,Stockbrokers,
For communicating and sharing information
For Internet banking - Internet Transaction
For online marketing
For making money
For entertainment
WWW and email are popular services given by Internet to users
is a standard way to download and copy files from one location to
another in the same or different machine
FileZilla is free application software for file sharing
Technological and non-technological elements are linked together is called Information infrastructure
Rapid development in Infrastructures
Messenger by foot
Messenger rode on animals
Postal mail system
Telegraph
Modern telephone system
Internet with interactive services
a collection of independent computers in a network that appear to the users of the system as a single coherent system
Examples
SAAS - Software as a Service
access Application Software and Databases in the cloud
PAAS - Platform as a service
enable customers to deploy in the cloud
IAAS - Infrastructure as a Service
refers to services providing computer processing power, storage space and network capacity, which enable customers to run software (including operating systems and applications) in the cloud
Wi-Fi,Wi-Max,Satellite are wireless technologies
1960 - Ted Nelson
Idea on WWW
1968 - Dr. Douglas C. Engelbart
1st working hyper text system called NLS
1990 -Tim Berners-Lee
developed a hyper text based document retrieval system called WWW for the Internet
viewing the information on WWW is called web browsing
Eg : Google Chrome, Mozilla Firefox, Apple Safari - PC ,Lap Top
Android Browser,Chrome,Opera mobile,Dolphin - for mobile device
protocol
location of the document (IP/domain name)
name of the document
Eg : http://www.bit.lk/about.html
www.bit.lk
http://www.bit.lk
https://172.20.10.70/contact.html
HTML
HTML Tags
<HTML>
<HEAD></HEAD>
<BODY></BODY>
<HTML>
has two main parts head and body
<HTML>
<HEAD>
<TITLE>Display in Title bar of the browser window</TITLE>
<META charset="UTF-8">
<META name="description" content="brief description of web page">
<META name="keywords" content="web,uscs,bit">
</HEAD>
<BODY>
<BODY>
</HTML>
An HTML Editor is a computer program for editing HTML.
There are various forms of HTML editors: text, object and WYSIWYG (what you see is what you get) editors.
Examples:
Microsoft FrontPage
BlueFish
Adobe Dreamweaver
First released by Sun Microsystems in 1995
OOP language (Client Side and Server Side)
can also be used to build small application (applets) for use as part of web pages
applets make it possible for creating user interaction web pages
import java.applet.*;
import java.awt.*;
public class Main extends Applet{
public void paint(Graphics g){
g.drawString("Welcome in Java Applet.",40,20);
}
}
<HTML>
<HEAD>
</HEAD>
<BODY>
<div >
<APPLET CODE="Main.class" WIDTH="800" HEIGHT="500"></APPLET>
</div>
</BODY>
</HTML>
web browser can read the text of the program and execute it
<!DOCTYPE html>
<html>
<body>
<h1>My first PHP page</h1>
<?php
echo "Hello World!";
?>
</body>
</html>
if requesting document has a php code web server first sends the PHP code through a PHP preprocessor
Server Side Scripting language
allowing any arbitrary application to be executed in the browser may poses a security threat
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: #b0c4de;
}
</style>
</head>
<body>
<h1>My CSS web page!</h1>
<p>Hello world!</p>
</body>
</html>
style sheet can define the fonts, and the color scheme to be used in displaying a document
collection of technologies used together to create interactive and animated
Static markp language
Client Side Scripting Language
presentation definition language
DOM
standard for how to get,change,add or delete a document
A method to access document link,anchors,forms and other objects
Ex:Google,Yahoo,Bing,Ask,Altavista,msn,mamma
Browsing – you know the information that you are looking for
Searching – using few keywords going through the web content
acts as a web-client
program that automatically fetches web pages
crawls over the web
also called web crawler
Web Page
link1
link2
link3
link4
link5
link6
A record that can be identified uniquely
Eg: DMOZ,Google Directory,Yahoo Directory
Search Engine
General Purpose SE
Tailor made SE
Meta SE
by combining multiple results from different search engines, Metasearch engine is able to enhance the user’s experience for retrieving information
mamma.com
for specific tasks
scholor.google.com
google,yahoo
having two types
have to install the e-mail client application on client's computer and configure it with mail server.
usually cannot access email from other computers
Eg:Outlook Express, Eudora, Thunderbird
Mailing List Types
Un-moderated lists
Moderated lists
One way lists
Contains few members
Have a moderator or set of moderators
Moderator Check the mail, for any inappropriate content before it is distributed to the subscribers
Unsubscribe:
view only some items that meet a certain criteria
2.Using Auto Reply Facility
reply with the same message when you are unable to read mail
able to use @ ofc too for replying messages with same criterias
3.By Blocking Junk E-mails
To avoid from spam
Ex: need high bandwidth
need special hardware
Reading a mail/ accessing web
Sending Audio
Sending Video
<
<
Ex: Video Conferencing
Ex: Windows OneDrive
Microsoft SharePoint
Ex:Public Radio International (PRI)
Ex:The Microsoft Network (msn)
webcasting is “broadcasting” over the Internet
broadcasting is - distribution of audio and/or video via electronic medium
web broadcasting - webcasting
transmission of audio and/or video data over the Internet for web users
refers to live streaming
users can watch or listen via web browsers
webcasters may include existing "TV/Radio Stations" and bunch of "Internet only stations"
either be distributed live or on demand
commonly used in business meetings , e-learning ,communication activities
save time and money
single content source to many simultaneous listeners/viewers
distribute music,photos,videos,games
How Fax Send Via Telephone System
Fax is the telephonic transmission of scanned printed material
Earlier used telephone line and fax modem for transferring fax
Internal Fax Modem
It is needed email-to-fax provider for sending Fax via Internet
Faster and Efficient than telephone system bcoz the Internet is designed for carrying digital data
No need external devices for converting data into digital data
Examples:
large interactive display that connects to a computer
User control the display using a pen,finger or stylus
board mounted to a wall or floor stand
shared document service in the Internet
many could view and edit single document simaltaneously
useful when document modifications are done
Commonly used as IPTV - Internet Protocol Television
television services are delivered using Internet Protocol Suite over LAN or the Internet
can be watched on regular TV / Computer / Portable Device
IPTV classified into three main groups:
What is Audio Conferencing...??
How TeleConferencing works...??
run software related to the program
com - 1
a participant enter all users
send a message to all participants
com1-msg
com3-msg
com2-msg
com4-msg
By accepting message all users can join to the conference
Digital Signals 100101010
Sound Signal
Sound Signal
What is Video Conferencing..??
enables to both hear and see
a set of interactive telecommunication technology
allow two-way simultaneous video & audio transmissions
enables face to face interaction
efficiency is higher when used with few people
digital compression technology is used to transmit audio and video streams in real time
What is Digital Compression ??
Community can use audio conferencing , video conferencing or text based chat with video suit their bandwith
No bandwidth limitations to conference
people can select any mode
How Internet Radio Works ??
To provide a way for reliable and efficient data transfer between two computers
To enable indirect or implicit access of computers which are physically not at the same location
To shield a user from different file storage schemes used in different operating systems
To promote sharing of files over a network
FTP SERVER
FTP CLIENT
Request files from FTP
Holds files to be send through FTP
FTP Server listens to the network for requests from a FTP client
after invoking the FTP service it is presented with a prompt and waits for command
FTP service can be used only after establishing a connection between the FTP client and the FTP server computers
must have a login identifier and a password to establish a connection to a server computer as well as for authentication purpose
ls - List the files in the current directory of the server computer.
cd - Change the current directory of the server computer.
Icd - Change the current directory of the client computer.
put - To copy a file from the client computer to the server computer.
mget - To download multiple files from the server to the client computer.
mput - To copy multiple files from the client computer to the server computer.
delete - To delete a file from the server computer.
mkdir - To Make a directory on the server computer.
Virus can spoil people money, time, resources,
irreplaceable data
International Computer Security Association - ICSA
increase awareness of the need for computer security and to provide education about various security products and technologies
Computer Virus is also a type of computer program
Replicate itself/ make an exact copy itself
Virus : harm within a computer
Trojan Horse : usually do not make copies of themselves
harmful to the computer when runs
distinguished as something useful
Worm : propagates itself across computers
creating copies of itself in each computer
infecting the entire network
Hoaxes : a false virus warning about a non-existent virus threat
Virus | Example |
Virus | Word Macro Virus -come attached and spread through Word and Excel files |
Trojan Horse | AOL4Free Trojan horse - Receives via e-mail -
Delete All Files in Hard Drive |
Warm | ILOVEYOU Warm - come as a E-mail - Scans all drive for multimedia files and replaces them with a copy of the worm |
a malicious type computer program
collects information about the activities of users
sends these information to a third-party over the Internet
It is designed specially for commercial purposes.
Track what types of websites a user is visiting
pop-up advertisements (called adware)
Alter the web browser’s settings to always redirect the users to commercial websites.
More malicious spyware steels the secret information of users, such as, passwords or credit-card numbers
Scan removable media before using.
open files attached to an email from only an known,trustworthy source.
When downloading files from the Internet, always ensure that the source is legitimate and reputable.
maintain backups
Dictionary attack:The program passes every word in a dictionary to the authentication system.
Brute force attack:Each and every combination of an alphabet is tried.
Hard to try more than 5 characters
Sniffer program: Listen to all the traffic in a computer network and discovers passwords
Can be reduced by using encrypted login protocols
Example: Open@rci23
Hardware firewall
Software FW : Windows Firewall,blackIce,Ip Table
Software Firewalls
Will gain all the information associated to the legitimate user
Do transactions by suspending the legitimate users
Cient
Server
user
123456
user
123456
123456resu
user
123456
Weaknesses and limitations in normal information exchange system
eavesdropping-secretly listen
vulnerable intruders secrectly listen to the information
methods use to overcome security vulnerable
hide data from unauthorized parties
Encryption :
converting electronic data into another form(called cryptography) which cannot be easily understood by anyone except authorized parties.
Decryption:
process of converting encrypted data back into its original form..It is understandable
Using Digital Certificate methods and Encryption Decryption methods system has assure the security
has two methods
PlainText
Cipher Text
PlainText
PlainText
Cipher Text
PlainText
Public Key
Private Key
Secret key Cryptography :
as same key use for encryption & decryption
Public key Cryptography :
Example: VeriSign, SecureNet, Certsign
Details of the issuer,Details of the owner,
The validity period,
The public key of the owner,
The thumbprint contains in the certificate
SFTP - Secure File Transfer Program
SSH - Secure Shell
cross-platform (exchange data between Mac,Win,Linux)
SSL - Secure Socket Layer
S-HTTP - Secure HTTP
SET - Secure Electronic Transactions
S/MIME - Secure / Multipurpose Internet Mail Extensions
non-repudiation - ensure that a transferred message has been sent and received by the real parties
Ethics on the Internet is often referred to as net etiquette or netiquette
is a set of unwritten rules of decent use of the Internet
There is more opportunities to violate the right of privacy in the Internet
Identity theft - Using the Internet, critical information about a person can be collected (NIC NO,Credit Card No)
Online Extortion - domain name squatting
Organized crime associations manage these issues..
Intellectual Property Rule - include copyright law and preventing copying digital data
Software Licences,Warrenty
Basic Tags
<!DOCTYPE html> - web browser to understand the version of the HTML used in the document
<h1>to<h6> - Heading tag
<p> - Paragraph tag
<center> -Center tag: center of the page or any table cell
Empty Element Basic Tags
-Non Breaking Space entity: Similar to space
Do not need opening and closing tags ,as there is nothing to go in between them
<hr /> -Horizontal line tag
<br /> -Line Break tag
Tag - <></>
Element - <>xxxxxxxxxxxxxx</>
Eg: Paragraph Tag and Element Respectivly
<P></P> <P>BIT first year</P>
One HTML element inside another HTML element
Eg : <P>I am<B>bold</B></P>
Example: <strong> <u> <td> <a> <img> <em>
Example:<h1><p><div><ul><ol><table>
Extra Information of a tag
Every attribute has two parts.
id - <P id="para1"></P>
title -
<P title="My Para">This appears cursor comes onthe Element </P>
class - <P class="para"></P>
style - <P style="font-family:arial; color:red;">arial red para</P>
name
value
Eg: align="right"
<HTML>
<BODY>
<P>1<SUP>st</SUP>.<STRIKE>Most broad definition of </STRIKE><I>eLearning</I> covers
any form of <B>technology enhanced learning mechanism.</B>
</P>
</BODY>
</HTML>
<html>
<body>
<p><b>This is test bold</b></p>
<p><strong>This is test strong</strong></p>
<p><i>This is test i-italic</i></p>
<p><em>This is test em- emphasize</em></p>
</body>
</html>
Normally browser reads <b><strong> && <i><em> as same
But future browsers not supporting <b> & <i> tags
Instead of that they consider them as styles(css properties)
Eg: font-style:bold;
font-style:italic;
<html>
<body>
<p style="color:#00ff00">
Value added services refer to the high level services which run on
top of the basic protocols and services. eLearning is one of these services.
</p>
<p style="color:#0000ff">
eLearning can be categorized along several axes: the underlying pedagogical assumptions, the content
model employed, and the size, distribution and level of network access of the learners.
</p>
</body>
</html>
<HR>Horizontal tag- display a border rule</HR> or <hr/> or <hr>
<html>
<body>
<p style="color:#00ff00">
Value added services refer to the high level services which run on
top of the basic protocols and services. eLearning is one of these services.
</p>
<hr align="center" width="1000px" size="10">
<P>1<SUP>st</SUP>.<STRIKE>Most broad definition of </STRIKE><I>eLearning</I> covers
any form of <B>technology enhanced learning mechanism.</B>
</P>
</body>
</html>
may be displayed with a blank line before and after the list
types: 1. Ordered List
2. Unordered List
3. Definition List
Ordered List
<html>
<body>
<ol>
<li>Ordered List</li>
<li>Unordered List</li>
<li>Definition List</li>
</ol>
</body>
</html>
Unordered List
<html>
<body>
<ul>
<li>Ordered List</li>
<li>Unordered List</li>
<li>Definition List</li>
</ul>
</body>
</html>
<html>
<body>
<dl>
<dt>Ordered List</dt>
<dd>can be numerical</dd>
<dd>can be alphabetical</dd>
<dd>"reversed" attribute is new in HTML5</dd>
<dt>Unordered List</dt>
<dd>bulleted list</dd>
<dd>"compact" and "type" attributes are not supported in HTML5</dd>
<dt>Definition List</dt>
<dd>dl tag defines a description list</dd>
<dd>dt define terms</dd>
<dd>dd define description</dd>
</dl>
</body>
</html>
Definition List
<html>
<body>
<dl>
<dt>Ordered List</dt>
<dd>can be numerical</dd>
<dd>can be alphabetical</dd>
<dd>"reversed" attribute is new in HTML5</dd>
<dt>Unordered List</dt>
<dd>bulleted list</dd>
<dd>"compact" and "type" attributes are not supported in HTML5</dd>
<dt>Definition List</dt>
<dd>dl tag defines a description list</dd>
<dd>dt define terms</dd>
<dd>dd define description</dd>
</dl>
</body>
</html>
<img src="myProject/test.jpg" title="test" alt="test" height="20px" width="21px">
alt - Specifies the character strings to be displayed on a text based browser in place of the image (alternative text for image)
Image Source - Path of the Image
Absolute path -
Full Path
C:\myProject\test.jpg
Relative Path - relative to the HTML file folder [src="../../test.jpg"]
hyperlink is an element, a text, or an image that you can click on, and move to another document
External Links:
can be a another HTML page, URL ,e-mail address
<a href="index.html" target="_blank">Visit Our Home Page</a>
<a href="http://www.slides.com/hasinigamage" target="_self">This is Our Slides</a>
<a href="mailto:me@openarc.lk" target="_top">mail me:</a>
Internal Links:
is specified with a relative URL (without http://www....)
<a href="#link1">second paragraph</a> describes the e-learning concepts.
_blank - opens the new page in a new window/ tab
_parent – opens the page in the parent frame
_self - opens the new page in the same window
_top- opens the linked document in the full body of the window
frameName – can specify any valid frame name
Creating a table..
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tfoot>
<tr>
<td>No</td>
<td>Foot</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>ARPANET</td>
<td></td>
</tr>
<tr>
<td>NSFNET</td>
<td></td>
</tr>
</tbody>
</table>
Colspan
<!DOCTYPE html>
<html>
<head>
<title>cols and rows span</title>
<style>
table, th, td {
border: 1px solid black;height:100px;
width:200px;
}
</style>
</head>
<body>
<table>
<tr>
<th>Month</th>
<th>Salary</th>
</tr>
<tr>
<td>January</td>
<td>Rs:2000</td>
</tr>
<tr>
<td colspan="2">Sum:2000</td>
</tr>
</table>
</body>
</html>
Rowspan
<!DOCTYPE html>
<html>
<head>
<title>Rowspan </title>
<style>
table, th, td {
border: 1px solid black;
height:100px;width:100px;
}
</style>
</head>
<body>
<table>
<tr>
<th>Month</th>
<th>Salary</th>
<th>Salary for holiday!</th>
</tr>
<tr>
<td>January</td>
<td>10000</td>
<td rowspan="2">500</td>
</tr>
<tr>
<td>February</td>
<td>8000</td>
</tr>
</table>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Cellpadding,cellspacing & caption </title>
<style>
table, th, td {
border: 1px solid black;
height:100px;width:100px;
}
</style>
</head>
<body>
<table cellpadding="30" cellspacing="10" >
<caption>Monthly Salary Sheet</caption>
<tr>
<th>Month</th>
<th>Salary</th>
<th>Salary for holiday!</th>
</tr>
<tr>
<td>January</td>
<td>10000</td>
<td rowspan="2">500</td>
</tr>
<tr>
<td>February</td>
<td>8000</td>
</tr>
</table>
</body>
</html>
Cell padding is the distance between a cell’s content and its border
Cell Spacing is the distance between cells
Caption,Cellpadding,Cellspacing,is Not Supported in HTML5
colors can be represented by
01. color names: aqua,black,blue,maroon
02. six digit hexadecimal :
* starts with #
* followed by three pairs of hexadecimal digits
* each pair defining the red, green, and blue values
#FFFFFF
GREEN
RED
BLUE
#000000 - Black
#ff0000 - Red
#00ff00 - Green
#0000ff - Blue
#ffffff - White
03. decimal
rgb(255,255,255)
RED
GREEN
BLUE
rgb(0,0,0) -black
rgb(255,0,0) -red
rgb(0,255,0) -green
rgb(0,0,255) -blue
rgb(255,255,255) -white
04. RGBA decimal value
adds an alpha value - a
a, specifing the opacity of the color
a=0=tranparent , a=1= opaque
rgba(255,60,0,0.3)
alpha value
Most elements have two color properties such as foreground color and background color
<style>
p{
color:#ff0000;
background-color:rgb(0,0,255);
}
</style>
What is Text color of paragraph ??
What is background color of paragraph ??
Blue
Red
Provide UI components for data entry
HTML DOC
web server
user
Send
Submit
PHP
Java
Data
Data
Forms contain form elements.
Eg: input elements, checkboxes, radio buttons, submit buttons
GET - method will send form data attaching to the URL
POST - method will send the data in the request body
<html>
<body>
<form action="myAction" method="GET">
<input type="hidden" value="studentId"/>
<input type="label" value="Full Name:">
<input type="text" />
<font color="#ff0000">*</font><br/>
<input type="label" value="Address:">
<input type="text" />
<font color="#ff0000">*</font><br/>
<input type="label" value="Gender" />
<input type="radio" value="Male" checked="checked"/>Male
<input type="radio" value="FeMale"/>FeMale<br/>
<input type="label" value="BioGraphy"/>
<input type="textarea" id="bio" name="bio" maxlength="100"><br/>
<input type="label" value="Password:">
<input type="password" /><font color="#ff0000">*</font><br/>
<input type="label" value="Retype Password:">
<input type="password" /><font color="#ff0000">*</font><br/><br/>
<input type="submit" value="Sign-Up" style="float:center;">
<input type="checkbox" value=""/>Send me NewsLetters
</form>
</body>
</html>
Form - Example
<!DOCTYPE html>
<html>
<body>
<form action="demo_form.jsp" method="get">
<input list="connections" name="connections">
<datalist id="connections">
<option value="WI-FI">
<option value="ADSL">
<option value="WI-MAX">
</datalist>
<input type="submit" value="Submit">
</form>
<p><strong>Note:</strong> The datalist tag is not supported in
Internet Explorer 9 and earlier versions, or in Safari.</p>
</body>
</html>
<datalist> tag specifies a list of pre-defined options for an <input> element
DATALIST
New in HTML5
main.html
menu.html
frameEx.html
<!DOCTYPE html>
<html>
<body bgcolor="#4a7d49">
<a href="http://www.google.com"
target="main_page">Google</a>
<br /><br />
<a href="http://www.microsoft.com"
target="main_page">Microsoft</a>
<br /><br />
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>HTML Target Frames</title>
</head>
<frameset cols="300, *">
<frame src="/UCSC/main.html" name="main_page" />
<frame src="/UCSC/menu.html" name="menu_page" />
<noframes>
<body>
Your browser does not support frames.
</body>
</noframes>
</frameset>
</html>
<html>
<body bgcolor="#b5dcb3">
<h3>This is main page and content
from any link will be displayed here.</h3>
</body>
</html>
1
1
2
2
3
3
UCSC
<iframe src="URL"> </iframe>
<iframe src="myIframe.html" name="myIframe" height="200"
width="20%" style="display:none;"></iframe>
<p>
<a href="http://www.linkedin.com" target="myIframe">My Professional network</a>
</p>
<!DOCTYPE html>
<html>
<head>
<base href="http://www.w3schools.com/images/" target="_blank">
</head>
<body>
<p><img src="first.gif" width="24" height="39" alt="First Image"></p>
</body>
</html>
EXtensible HyperText Markup Language
Follows XML rules on HTML
stricter and cleaner version of HTML
almost identical to HTML 4.01
* XHTML DOCTYPE is mandatory
* The XML namespace attribute in <html> is mandatory
* <html>, <head>, <title>, and <body> is mandatory
Elements:
* must be properly nested
* must always be closed
* must be in lowercase
* must have one root element (html)
Removed tags :<applet>,<center>,<font>,<frame>,<frameset>,<noframes>,<tt>
new attributes to <input>element in HTML5
required,autocomplete,max,min,pattern
Eg:<input type="text" name="postal_code" pattern="[A-Za-z]{3}" title="postal code">
HTML5 <!DOCTYPE>
SGML is a system for defining markup languages
The DTD(Document Type Definition) defines the syntax of markup constructs
<!DOCTYPE html>
<html>
<body>
<p>Click on the sun or on one of the planets to watch it closer:</p>
<img src="planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap">
<map name="planetmap">
<area shape="rect" coords="50,50,50,50" alt="Sun" href="sun.htm">
<area shape="circle" coords="90,58,3" alt="Mercury" href="mercur.htm">
<area shape="circle" coords="124,58,8" alt="Venus" href="venus.htm">
</map>
</body>
</html>
Value | Description |
x1,y1,x2,y2 | Specifies the coordinates of the left, top, right, bottom corner of the rectangle (for shape="rect") |
x,y,radius | Specifies the coordinates of the circle center and the radius (for shape="circle") |
x1,y1,x2,y2,..,xn,yn | Specifies the coordinates of the edges of the polygon |
The coordinates of the top-left corner of an area are 0,0
HTML5 <video> element specifies a standard way to embed a video in a web page
<!DOCTYPE html>
<html>
<body>
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
<source src="movie.webm" type="video/webm">
Your browser does not support the video .
</video>
</body>
</html>
HTML5 <audio> element specifies a standard way to embed audio in a web page
<!DOCTYPE html>
<html>
<body>
<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
<source src="horse.wav" type="audio/wav">
Your browser does not support the audio element.
</audio>
</body>
</html>
<style>
p {color:green}
</style>
body {
background-color : lightgrey ;
}
selector_expression - expression match with html element or tags
Ex: p,table,div,h1
element_property -which properties of
the element the definition will affect
Ex:color,font-size,font-family
property_value(s) - how the property
should affect
Ex:red,14px,verdana
~ Screen measures in pixels - px
~ Inches - in
~ Centimeters - cm
~ Millimeters - mm
~ Points - pt (1pt = 72in)
~ Picas - pc (1pc=12pt)
~ Realative to the font Size - em
~ Relative to the x-height - ex
~ Degrees - deg
~ Grads - grad
~ Radians - rad
~ Percentages - x%
~ hertz - Hz /kilohertz-kHz
CSS keywords & Color codes are also used as property values
Ex: thick, thin ,inherit ,#ff0000
is the definition of a formatting Style that can be applied to a HTML Element
has three parts
Element{property:value}
Element Selector
Class Selector
Id Selector
Grouped Selector
Context Selector
<HTML>
<BODY>
<DIV >
<P class="paraClz" ><B>My Paragraph</B></P>
<P class="paraClz" id="firstPara">My Paragraph</P>
<P class="paraClz" id="secondPara">My Paragraph</P>
<P class="paraClz" id="thirdPara">My Paragraph</P>
</DIV>
</BODY>
</HTML>
HTML Example Code for Understanding CSS Selectors
<STYLE>
P{color:#ffffff;}
#firstPara{color:#000000;font-size:14px;}
.paraClz{background-color:#00ff00;font-size:16px;}
P,DIV{background-color:#00ff00;font-size:16px;border-style:solid;}
P B{font-face:verdana;}
</STYLE>
Element Selector
ID Selector
Class Selector
Context Selector
Grouped Selector
01.Inline Style Sheet
can be used to apply unique style to single html page
multiple styles can be defined, separated with semi-colon
<h1 style="background-color:#ffff00;margin-left:30px;"> My Inline CSS </h1>
02.Embedded Style Sheet
define the style within the head, and then apply the style in the body
<HEAD>
<STYLE>
h1{
background-color:#ff0000;
color:#ffffff;
margin: 25px 50px 75px 100px;
}
</STYLE>
</HEAD>
03.Linking StyleSheet
<head>
<link rel="stylesheet" type="text/css" href="test.css">
</head>
test.css
h1 {
font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size:13px;
color: #000000;
background-color: #e4e4f5;
background-image: url('../images/button/normal.gif');
border: medium none;
cursor: hand;
width:90px;
height:22px;
}
External Style Sheet is a separated style sheet from HTML page saved with .css extension
04.Import Style Sheet
lets us attach a new CSS file from within CSS itself
<HEAD>
<STYLE type="text/css">@ import "styleImport.css"</STYLE>
</HEAD>
<STYLE>
div{
color:#0000ff;
}
div.div1{
color:inherit;
}
div.div2{
color:initial;
}
</STYLE>
What would be the color of div1 ???
Blue
What would be the color of div2 ???
Default color - Black
CSS text properties allow to control the appearance of text
p1{
color:rgb(0,0,255);
direction:ltr;
line-height: 1%;
letter-spacing: 2px;
text-align: center;
text-decoration: overline;
text-indent: 50px;
white-space: nowrap;
word-spacing: 30px;
}
Text Properties | ||
---|---|---|
Property | Description | Values |
color | Set color to the text | #ffffff/white/rgb(255,255,255) |
direction | Specifies the writing direction | ltr/rtl/initial/inherit |
letter-spacing | Increases or decreases the space between characters in a text | normal/x px / x cm / -x px/ initial / inherit |
line-height | Sets the line height | normal / 3 / 20px / 20% / initial / inherit |
text-align | Specifies the horizontal alignment of text | left /right /center /justify / initial / inherit |
text-decoration | decoration added to text | none /underline / overline / line-through /initial /inherit |
text-indent | indentation of the first line in a text-block | 10px /10cm /10% /initial /inherit |
vertical-align | vertical alignment of an element | super / sub / xpx/ -xpx /initial /inherit |
white-space | Specifies how white-space inside an element is handled | nowrap / normal / pre /initial /inherit / |
word-spacing | Increases or decreases the space between words in a text | normal / xpx / xcm /-xpx /initial /inherit |
List property:
ul{
list-style: square url("test.gif");
list-style-image:url('test.gif');
list-style-position:inside;
list-style-type:upper-roman;
}
List Properties | ||
---|---|---|
Property | Description | Values |
list-style | sets all the properties for a list in one declaration | disc outside none/initial /inherit |
list-style-image | specifies an image as the list-item marker | url('x.gif') / none /initial /inherit |
list-style-position | specifies if the list-item markers should appear inside or outside the content flow | inside / outside / initial / inherit |
list-style-type | specifies the type of list-item marker | for ol -upper-roman /lower roman / upper-alpha / lower-alpha / decimal; for ul - disc / circle / square; /none |
Fonts are styled collection of letters and symbols
Font Properties
font-size
font-size-adjust
font-style
font-variant
font-weight
font-strech
line-height
p{
font: 15px arial, sans-serif;
}
P{
font-style: italic;
font-variant: small-caps;
font-family: "Times New Roman", Georgia, Serif;
font-stretch: expanded;
}
Margin
the space around elements
div{
margin-top: 100px;
margin-bottom: 100px;
margin-right: 150px;
margin-left: 50px;
}
shorthand property
div{
margin:20px 40px 50px 100px;
}
4
1
div{
margin:25px;
}
For Equal Values
border
p.one {
border-style: solid;
border-width:5px;
border-color: red;
}
p {
border: thin solid red;
}
If we consider a single property value assigning sequence similar to the margin
p {
border-style: dotted solid dashed double ;
}
Static - Default
Fixed - will not move even if the window is scrolled
Relative - relative to its normal position
Absolute - absolute position element is positioned relative to the first parent element
<!DOCTYPE html>
<html>
<head>
<title>Positioning</title>
<style>
#abs{
position: absolute;
left: 100px;
top: 150px;
}
#fixd{
position: fixed;
left: 100px;
}
#stic{
position: static;
top: 150px;
}
#relatv{
position: relative;
left: 10px;
}
</style>
</head>
<body>
<p id="fixd"> fixed position fixed position fixed position fixed position fixed position fixed position fixed position</p>
<p id="stic"> static position static position static position static position static position static position </p>
<p id="relatv">relative position relative position relative position relative position relative position </p>
<p id="abs">absolute position absolute positionabsolute positionabsolute positionabsolute positionabsolute position</p>
<p id="wop"> No positionNo positionNo positionNo positionNo positionNo positionNo positionNo position</p>
</body>
</html>
Without Positioning
With Positioning
<!DOCTYPE html>
<html>
<head>
<style>
img {
position: absolute;
left: 0px;
top: 0px;
z-index: -1;
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<img src="w3css.gif" width="100" height="140">
<p>Because the image has a z-index of -1, it will be placed behind the text.</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
img {
position: absolute;
left: 0px;
top: 0px;
z-index: 1;
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<img src="w3css.gif" width="100" height="140">
<p>Because the image has a z-index of 1, it will be placed front of the text.</p>
</body>
</html>
What is JavaScript ????
Client Side Scripting Language
is used mainly in webpages for making websites interactive
embedded directly into HTML pages using <style> tag
can use JavaScript without purchasing a license
consists with executable computer code
an interpreted language
JavaScript was created in 1996 by the Netscape team and released with Netscape 2.0.
Static Web Page
do not change the content or layout depending on user input
Dynamic Web Page
change the content or layout depending on user input or computing environment
Client-Side Scripting Languages
Client-side programming is the name for all of the programs which are run on the Client
Examples:
Using Script Tag
JavaScript can be placed in the <body> and the <head> sections of an HTML page
<script>
function getCode(){
alert("script can be placed within body and head");
}
</script>
Use an External Script file
<!--using new Date()-->
<!DOCTYPE html>
<html>
<body>
<div id="displayDate"></div>
<script>
var day = new Date();
document.getElementById("displayDate").innerHTML = day;
</script>
</body>
</html>
<!-- using new Date(milliseconds)-->
<script>
var day = new Date(86400000);
document.getElementById("displayDate").innerHTML = day;
</script>
<!--new Date(dateString)-->
<script>
var day = new Date("February 08, 2015 10:30:00");
document.getElementById("displayTime").innerHTML = day;
</script>
<!-- new Date(year,month,day,hours,minutes,seconds,milliseconds)-->
<script>
var day = new Date(2015,2,8,10,35,30,4);
document.getElementById("dispalyDate").innerHTML = day;
</script>
getDay()
<!DOCTYPE html>
<html>
<body>
<script>
function myFunction() {
var day = new Date();
var today= day.getDay()
document.write("This is the "+today+" day of this week");
}
myFunction();
</script>
</body>
</html>
getDate()
<!DOCTYPE html>
<html>
<body>
<script>
function myFunction() {
var day = new Date();
var today= day.getDate()
document.write("This is the "+today+" day of this month");
}
myFunction();
</script>
</body>
</html>
getMonth()
<!DOCTYPE html>
<html>
<body>
<script>
function myFunction() {
var day = new Date();
var mnth= day.getMonth()
document.write("This is "+mnth+" month of this year.");
}
myFunction();
</script>
</body>
</html>
Properties
document.title
alert Box
confirm Box
prompt Box
<script>
alert("You Have One More Chance");
</script>
User must click "OK" to proceed in alert..
confirm("Press OK to agree");
User can click either"OK" or "Cancel" to proceed in confirm..
prompt("Please enter your Course", "UCSC");
User can input values and Click "OK" or "Cancel" to proceed in prompt
stands for EXtensible Markup Language
a text-based markup language much like HTML
derived from Standard Generalized Markup Language (SGML)
By Hasini Thamarasa
A presentation on Web Application Development for undergraduate students (UCSC,UoM)