SlideShare a Scribd company logo
1 of 117
1
Web Technology
Client Side Technology
2
We need to answer…
…How is the Internet organised?
…How do we find and retrieve pages on the
Internet?
…How is this data (web pages, etc)
transmitted over the Internet?
…How is what we see in the browser window
defined as a collection of data?
http://www.user-agents.org/
3
Clients and Servers
The Web is a client/server application: Web
browsers are clients which send requests to Web
servers, which send responses back.
4
Fetching Pages over the Internet
Architecturally, the Internet consists of a collection
of layers, each one providing services for the one
above it:
The Internet Layer gets packets to their destinations;
The Transport Layer sends streams of data;
The Application Layer provides high-level services to
applications such as Web browsers.
5
HTTP
HTTP makes use of TCP to open connections between
clients and servers and to pass the requests and responses
between them.
When a user clicks a link or types a web address:
1. A TCP connection is opened between browser and server
2. Then requests and responses are sent back and forth using
HTTP
HTTP is a stateless protocol, meaning each request for data
is dealt with in isolation; once the server sends the
response, it forgets everything about the original request.
6
Fetching Pages over the Internet: HTTP
/ response
HTTP
Hypertext Transfer Protocol
TCP
Transmission Control Protocol
IP
Internet Protocol
7
HTTP in Context
Major steps in a "browser process"
Client Origin
server
HTML
http://origin/..http://origin/..
DNS
server
DNS query
Establish TCP connection
HTTP request
Optional parallel connections
HTTP response
HTTP
transaction
8
Uniform Resource Locators (URLs)
Without a universal addressing mechanism, it would be
impossible to navigate to a site, and page linking would not
be feasible
Uniform Resource Locators (URLs) are used to identify
Web pages — basically a URL is a web address
URLs have 3 components:
A Prefix (usually http:// )
A Hostname: (such as www.cityu.edu.hk)
A Path: (such as /scm/index.htm)
9
Uniform Resource Locators (URLs)
Example:
http://www.cityu.edu.hk/scm/index.htm
Prefix
The transfer protocol
required to request data
from the server
Host name
Identifies a particular
computer somewhere on
the Internet
Path
Identifies a file within a
hierarchical directory
structure on the server
10
Uniform Resource Locators (URLs)
Example:
http://www.cityu.edu.hk/scm/index.htm
Prefix
The transfer protocol
required to request data
from the server
Host name
Identifies a particular
computer somewhere on
the Internet
Path
Identifies a file within a
hierarchical directory
structure on the server
11
IP Addresses and DNS
Every computer connected to the Internet must
have a unique IP address, no matter whether it’s a
client or a server (or both)
An IP address is just a number that identifies a
host on the Internet. Example:
212.171.218.34 or 144.214.5.218
The Domain Name System (DNS) is a database
that matches IP addresses to host names
12
Domain Names
And the Domain Name System (DNS) translates
host names into IP addresses, which are then
used by TCP to establish connections between
HTTP clients and servers.
Domain names are administered in such a way
that they are guaranteed to be unique.
Domain names are organised in a hierarchical
structure….
Internet Corporation for Assigned Names and Numbers (ICANN)
https://www.icann.org/
13
Top Level Domains
www.cityu.edu.hk
www.cityu.hk
www.apple.com
Top Level
Domain (TLD)
Mostly country
domains:
.uk, .au, .hk, etc.
Generic Top Level
Domain (gTLD)
.com
.org
.net
.biz
.info
.name
.ws
.tv(.edu, .gov, .mil restricted to US only)
14
Second Level Domains
www.cityu.edu.hk
www.cityu.hk
www.apple.com
The actual name of
the organisation or
service.
Can contain letters
(a to z),
numbers (0 to 9),
dashes ( - )
15
Third Level, or Sub Domains
www.cityu.edu.hk
sweb.cityu.edu.hk
www.apple.com
store.apple.com
seminars.apple.com
Strings of characters
that designate
different services, or
hosts within the
second level domain.
E.G. “www” for the
core or main website,
“sweb” for SCM’s
sub-network within
CityU.
SM5312 week 5: web technology basics 16
http://www.cityu.edu.hk/scm/index.htm
Paths
Prefix
The transfer protocol
required to request data
from the server
Host name
Identifies a particular
computer somewhere on
the Internet
Path
Identifies a file within a
hierarchical directory
structure on the server
17
Home Page Naming
For…
http://www.cityu.edu.hk
…there must be a default HTML page that is displaying as
the home page. In the case of CityU, it is…
http://www.cityu.edu.hk/index.html
…meaning index.html is the default HTML page in the root
directory of the server.
18
Home Page Naming
Web servers will automatically serve up pages file-named
index.html
index.htm
default.htm
default.html
…as long as ONE page by those filenames resides in the
root directory of your site.
If you want to use a page by another name as the home
page of the site, you will have to configure the server
software to point to that page.
19
Web Page Naming (HTML naming Conventions)
All lower-case, no spaces, no special characters
[other than dash ( - ) or underscore ( _ ) ].
products.html
Products.html
products_sept07.html
products sept/07.html
The same applies to the name of folders and sub-
folders within your site.
recommended
ok, but not recommended (esp. in XHTML)
recommended
not recommended
Technologies Overview
Client Side Technologies
HTML, CSS, JavaScript
XHTML, DHTML, AJAX, HTML5,FLASH
Server Side Technologies
ASP, PHP, Perl, JSP, Node JS
ASP.NET, Java,C++,C#
MySQL, SQL Server, Access
Technologies Overview
Some More Advanced Technologies
XML, XSLT, RSS, Atom
X-Path, XQuery, WSDL
XML-DOM, RDF
Ruby on Rails, GRAIL Framework
REST, SOAP
22
23
The publishing language used by the World Wide
Web is
HTML (from Hyper-text Markup Language).
Documents
Document = page = HTM file = topic
Content (text, images)
Tags (display commands)
HTML (Hyper-text Markup Language)
That’s how this…
<html>
<head><title>Welcome onboard</title></head>
<body bgcolor=“#f4f4f4">
<h1>Welcome</h1>
<img src=“dcetech.gif" width=“222" height=“80" alt=“DCETECH"
BORDER="0“ />
<h2>A Message from the Speaker </h2>
<p><font color=red>Good evening! Thank you for coming here!</font></p>
<p>Hello and welcome to Web technologies workshop! I'm <b>Ankit
Jain,</b>, 4th
year Computer Engg <a href=“http://dcetech.com"> Head
DCETECH.COM </a>. Dcetech is a student portal and only one of its kind in
India.It is not only a technical oriented site which caters only for
engineers but its for students from any background! Also students from any
educational institution can register and join Dcetech. </p>
. . .
</body>
</html>
Turns into this…
An HTML page is a tree of html elements
HTML Elements
Begin with a (<); end with a (>)
Most tags are paired into beginning and ending
tags; for
example,
<b>Hello</b> world
Hi <i>Ahmed</i> Ali
<hr><br>
<b><i>Hello</i></b> world
HTML Tags
Some HTML Tags example
START TAG END TAG
<HTML> </HTML>
<HEAD> </HEAD>
<TITLE> </TITLE>
<BODY> </BODY>
<H1>, <H2>, ... </H1>, </H2>, ...
<IMG ...> </IMG> (optional)
<A ...> </A>
<P> </P>
<BR/> (none; "empty" tag)
<OL> </OL>
<UL> </UL>
<LI> </LI>
Basic Structure of HTML document
Example of basic tag positioning
<html>
<head>
<title>Title bar text</title>
</head>
<body>
<p>Look, I'm a paragraph!</p>
</body>
</html>
<html>
<head>
<title> Introduction to web
development </title>
</head>
<body>
<p>Welcome to HTML!</p>
</body>
</html>
Basic Structure
Title tags
Body tags
32
What Comes in the Head
Optional elements
<html>
<head>
<title>Title</title>
<base href="..."> Path for relative URLs
<script>...</script> Embedded script
program
<style>...</style> Cascading style sheet
<link...> File associations
<meta...> Document information
<meta Name=“P. Michiardi” Content=“Lecture 1”>
</head>
<body>
</body>
</html>
Meta tags are used to store information usually
relevant to browsers and search engines.
<META name="DESCRIPTION" content="AN HTML Tutorial">
<META name="KEYWORDS" content="html, webdesign, javascript">
<META name="GENERATOR" content="Frontpage 3.0">
<META name="AUTHOR" content="Bill Gates">
<META http-equiv="REFRESH" content="5; url=http://www.echoecho.com">
<META http-equiv=“expires" content=“Sun, 31 Jan 2005 17:35:00 GMT ">
Meta tag
<body bgcolor=“#FFFFFF” link="#C0C0C0" vlink="#808080"
alink="#FF0000“>
attributes of body section :
link
vlink
alink
Bgcolor
Background
Bgproperties fixed
Topmargin / leftmargin / bottommargin / rightmargin
Body Section
Text
Formatting
Resizing
Layout
Listing
Images
Inserting images (GIF and jpg)
Adding a link to an image
Links
To local pages
To pages at other sites
To bookmarks
Tags inside BODY SECTION
• Background
• Colors
• Images
• Fixed Images
• Tables
• Frames
• Forms
TEXT FORMAT
<b>text</b> writes text as bold
<i>text</i> writes text in italics
<u>text</u> writes underlined text
<sub>text
</sub> lowers text and makes it smaller
<sup>text
</sup> lifts text and makes it smaller
<blink>text</blink> guess yourself! (Note: Netscape only.)
<strike>text</strike> strikes a line through the text
<pre>text</pre> writes text exactly as it is, including spaces.
<strong>text<strong>
makes text bold
TEXT SIZE
These are the tags for changing the font size.
<big>text</big> increase the size by one
<small>text</small> decrease the size by one
<h1>text</h1> writes text in biggest heading
<h6>text</h6> writes text in smallest heading
<font
size="1">text</font>
writes text in smallest font size. (8 pt)
<font
size="7">text</font>
writes text in biggest font size (36 pt)
TEXT LAYOUT
<p>text</p>
Adds a paragraph break after the text.
(2 linebreaks).
<p align="left">text</p> Left justify text in paragraph.
<p align="center">text</p> Center text in paragraph.
<p align="right">text</p> Right justify text in paragraph.
text<br> Adds a single linebreak where the tag is.
<nobr>text</nobr>
Turns off automatic linebreaks
- even if text is wider than the window.
<center>text</center> Center text.
<div align="center">text</div> Center text.
<div align="left">text</div> Left justify text.
<div align="right">text</div> Right justify text.
Images types used in browsers are : GIF & JPG
<img src="http://www.haneen.com.eg/logo.gif">
<img src="logo.gif">
Resizing
<img src=“logo.gif" width="60" height="60">
HTML Images
SPACING AROUND
<img src="rainbow.gif" Hspace="30" Vspace="10">
ALIGNMENT OF IMAGES
You can align images according to the text around it
Default, left, right, top, texttop, middle, center
ALTERNATIVE TEXT
<img src=“logo.gif" alt="This is a text that goes with the
image">
HTML Images
Possible shapes for areas inside image are
<area shape=rect coords= x1,y1, x2,y2 Href="http://www.domain.com">
<area shape=circle coords= x1,y1, x2,y2 Href="http://www.domain.com">
<area shape=polygon coords= x1,y1, x2,y2, .., xn,yn
Href="http://www.domain.com">
Example
<img src="rainbow.gif" usemap = #example border=0>
<map name=example>
<area shape=Rect Coords=0,0,29,29 Href="http://www.yahoo.com">
<area shape=Rect Coords=30,30,59,59 Href="http://www.hotbot.com">
</map>
Image map
Click <a href="http://www.yahoo.com">here</a> to go to yahoo.
COLORS ON TEXT LINKS
<body link="#C0C0C0" vlink="#808080" alink="#FF0000">
LINK TARGETS
<a href="http://www.yahoo.com" target="_blank">
HTML Links
Image link
<a href="myfile.htm"><img src="rainbow.gif"></a>
<a href="myfile.htm"><img src="rainbow.gif" border="0"></a>
Link to email
<a href="mailto:youremailaddress">Email Me</a>
<a href="mailto:email@hotmail.com?subject=SweetWords">Send
Email</a>
<a href="mailto:email@hotmail.com?body=Please send me a copy of
your new program!">Send Email</a>
<a href="mailto:email@hotmail.com?subject=SweetWords
&body=Please send me a copy of your new program!">Email Me</a>
HTML Links
LINK WITHIN A PAGE
To link to an anchor you need to:
• Create a link pointing to the anchor
• Create the anchor itself.
1.<a name="chapter4"></a>
2.Click <a href="#chapter4">here</a> to read chapter 4.
When you link to anchors on external pages use this syntax
<a href="http://www.yahoo.com#YahoosAnchor">blabla</a>
HTML Links (cont.)
BULLETED LISTS
You have the following
bullet options:
disc
circle
square
<ul>
<li>text</li>
<li>text</li>
<li>text</li>
</ul>
<ul type="disc">
<ul type="circle">
<ul type="square">
 You have the following number options:
◦Plain numbers <ol>
◦Capital Letters <ol type="A">
◦Small Letters <ol type="a">
◦Capital Roman Numbers <ol type="I">
◦Small Roman Numbers <ol type="i">
<ol>
<li>text</li>
<li>text</li>
<li>text</li>
</ol>
<ol start="5">
NUMBERED LISTS
Client Side
Web Technologies
HTML & CSS
Lect. - 2
A web page, broken down
Web Browser
Content/Data UI Logic
Styling
Rules
Website
A web page, broken down
Web Browser
HTML JavascriptCSS
Website
HTML Tag Structure
<textarea rows="4" cols="30">
blah blah blah
</textarea>
Tag (Element) name
Attribute name
Attribute value
Tag contents
Hexadecimal Colors
#F62BB5
Hexadecimal Colors
R G B
#000000
00 = 0
FF = 255
Hexadecimal Colors
R G B
#000000
16^6 = 16,777,216 possible colors
HTML-FORMS
How form works ?
55
56
HTML Forms
Used to send data back to the server to be processed.
<form></form>
Contains:
control elements that get data from the user
label elements
Attributes:
• action url of page where data is sent
• method GET/POST http request method
Form - controls
Controls must have name and value attributes to
be submitted.
Controls can be disabled using disabled attribute.
Each control has an initial value and a current
value.
Form- Control Types
Buttons:
To submit form:
• <input type=“submit” />
• <button type=“submit”></button>
To reset form:
• <input type=“reset” />
• <button type=“reset”></button>
Just a button with no default behavior
• <input type=“button” />
• <button type=“button”></button>
Checkboxes:
On/off switches
• More than one can share the same name to allow to select
several values
• Checked attribute is set to make initial value “on”
• <input type=“checkbox”/>
Form- Control Types
TextBox:
Single line text input
• <input type=“text”/>
Password: Similar to TextBox, but input text is rendered
as a series of asterisks or similar characters
But submitted as plain clear text
• <input type=“password” />
Form- Control Types
RadioButtons:
On/off switches but are mutually exclusive
More than one share the same name to create a
mutually exclusive group
Checked attribute is set to make initial value “on”
• <input type=“radio”/>
Form- Control Types
DropDown Lists/Menus:
To choose one/more from multiple options
• <select name=“……”></select>
To select multiple options use multiple attribute
• <select name=“……” multiple></select>
To define items use
• <option></option>
Option can have name, value and selected attributes
Form- Control Types
DropDown Lists/Menus:
To logically group options use optgroup
• <optgroup label=“…..”></optgroup>
• http://www.w3schools.com/tags/tryit.asp?
filename=tryhtml_optgroup
Label attribute is the value that appears in the list
Form- Control Types
File select:
Allow users to select files to be submitted to a form
• <input type=“file” />
Form- Control Types
Hidden controls:
Not rendered visually
Values are submitted with the other form data
Can help overcome stateless nature of HTTP
• <hidden name=“… ” value=“… ” />
Form- Control Types
Textarea controls:
Multiline text input
Value is the content nested in the control
• <textarea>Content </textarea>
• Has rows and cols attributes to set size of textarea.
Form- Control Types
Label
Specify a label for controls that don t have an implicit‟
label
For attribute MUST match ID value of the control
attached to it
Useful for speech synthesizers readers
• <label for=“fname”>First Name :</label>
Form- Control Types
Structuring Form
Use <fieldset> and <legend> to group related
controls and labels
Block vs. Inline Elements
Inline Block
No newlines before or after it Newlines appears before and after it.
 Page flow is not broken 
Has no width and height Can have a width and height
Takes as much width of the page as the
content 
Takes the whole page width
Can contain only inline elements Can contain inline or block elements
Examples:<span>, <a>, <img >, <b>,
<em>,<input<
Examples:<p>, <div<
CSS coming up...
CSS
Cascade Style Sheets (CSS)

Cascading = styling rules "cascade“

From parent tags to child tags

Rules can override others
Style = style
Sheet = file
Basic CSS Structure
( tag name/class/id)
{
(rule);
(rule);
...
}
CSS Rules Syntax
Example
Body { background-color:blue;
color:white;
font-size:24pt;
property1: value1;
property2: value2;
}
p { property: value3; color:yellow;
Where to add CSS?
Inline style attribute
Applied to a single element
• <p style=“color : pink ; font-size : 30pt ;”
In <head> Applied to an entire single page
• <head>
<style> body{ font-family : arial ;
background-color : black ;
color : white ; }
p { color : pink ; }
</style>
</head>
In external sheet (.css)
Applied to any html file linked to it
• <head>
<link rel=“stylesheet” type=“text/css”
href=“style.css” />
</head>
Where to add CSS?
CSS Selectors
Simple Selectors
• element, class, ID
• Select by name of element (h1, p, div, span, …..etc. Example:
p { font-size:20pt; }
Group Selectors coma-separated list of selectors
Class Selector
Select an element by the class attributes defined
Class is an attribute of most html elements,
specifies one or more class names (space-
separated list)
Example: .maincontent /*select any element with
class=“maincontent” */
H1.headerTitle { font-size : 20pt; } /*select the all
h1 with class=“headerTitle” */
.x { color : red; }
ID Selector
Select an element by the ID attributes defined
ID is an attribute of all html elements, it must be
unique throughout a certain html page
Example: #maincontent /*select the element with
id=“maincontent” */ { font-size : 20pt; }
h1#headerTitle /*select the only h1 with
id=“headerTitle” */
#x { color : red; }
Attribute Selector
Select an element by the attributes defined in it
Example:
[href] /*select any element with attribute named href*/ {
font-size : 20pt ; }
h1[title] /*select any h1 element with title attribute
defined */ { color : red ; }
a[href =“ http: //www. Google .com”] /*select any a
element with href exactly equal http://www.google.com
*/ { color : blue ; }
Combinatory
This selectors specified by relation between
elements
Descendant
Direct Childof (>)
Adjacent Sibling (+)
General Sibling(~)
Examples:
• h1 strong {……..} /*strong descendant of h1 i.e. inside */
• div ol > li p{…….} /*p descendant of li which is a direct child of ol
which is a descendant of div*/
• span + p {……..} /*p that is a direct adjacent sibling to a span*/
• a~p{………} /*p that is sibling of a it may be adjacent or not*/
Colors
#-hexadecimal
rgb() and rgba()
hsl() and hsla()
To get full list of color keywords:
http://www.w3schools.com/colors/colors_picker.asp
http://www.colorcombos.com/
Units in CSS
pixel (px) absolute value
em: ratio of context size relative to surrounding
text
percentage: percentage of context size
CSS Text Formatting
color: name|#hex|rgb()|rgba()|hsl()|hsla();
/*foreground color*/
letter-spacing: normal|length (px,%,em);
line-height: normal|number|length|percentage;
text-align: left|right|center|justify;
text-decoration: none|underline|overline|line-
through|blink;
text-indent: length|percentage;
text-transform: capitalize|uppercase|lowercase|none;
text-shadow: rightpx bottompx blurpx color;
direction: ltr | rtl; text-indent: length|percentage;
text-transform: capitalize|uppercase|lowercase|none;
text-shadow: rightpx bottompx blurpx color;
direction: ltr | rtl;
CSS Text FormattingCSS Text Formatting
CSS Font
 font-family :list of fontnames to chose from
font-style: normal|italic|obliquefont-variant: normal|
small-caps
font: font-family font-size font-weight font-style
font-variant
@font-face {
font-family: 'YourFontName'; /*a name to be
used later*/
src: url('http://domain.com/fonts/font.ttf');
/*URL to font*/ }
Then, trivially, to use the font on a specific
element:
.classname { font-family: 'YourFontName'; }
https://fonts.google.com/
Use @font-face
Background formatting
background-attachment : scroll | fixed;
background-color : color;
background-image : none/url (path);
background-position : percent|length|
(top left right bottom center)
background-repeat : repeat | repeat-x|
|repeat-y|no-repeat
background-size : length|percentage|
Selection based on parts of elements Identified
by ::first-letter
::before
::after
::first-line
ex:
• p::after { content : ”this content is added after the p”
color:red;
}
PseudoElement Selector
Example
Selectors.html
Selectors.css
http://www.w3schools.com/cssref/css_selectors.asp
Pseudo Class Selector
Selection based on special effects, Identified by ”:”
Link:
• :visited, :target
User actions:
• :hover, :active, :focus
UI elements states:
• :enabled, :disabled, :checked
Structural :
• :first-child, :last-child, :nth-child(), :empty, :not()
Pseudo Class Selector (Cont. d)‟
Example:
a:hover { font-size:20pt; } /*applied when mouse hover
over any link */
a.red:hover { font-size:20pt; } /*applied when mouse
hover over link with class=“red” */
Input[type=“text”]:disabled { color:red; }
/*applied to any textbox which is disabled */
Visual Formatting and LayoutVisual Formatting and Layout
CSS layout and formatting
After parsing the html into a document tree (DOM)
Each node is rendered as one or more rectangular
boxes
Types of Boxes:
Block Boxes :
• For block elements ex. div, p
• Elements with display : block| list-item| table
Inline Boxes:
• For inline elements ex. span, b, em
• Elements with display : inline | inline-table | inline-block;
Block vs. Inline Elements
Inline Block
No newlines before or after it Newlines appears before and after it.
 Page flow is not broken 
Has no width and height Can have a width and height
Takes as much width of the page as the
content 
Takes the whole page width
Can contain only inline elements Can contain inline or block elements
Examples:<span>, <a>, <img >, <b>,
<em>,<input<
Examples:<p>, <div<
The BOX Model
Applied to block level elements
Applies to block-level elements
Overall dimension of element =
Height/width + padding + border + margin
BOX Model
.box {
width:300px;
height:200px; padding:10px;
margin:15px;
border: 1px solid #000;
}
How to center a block?
Centered Text
HTML File
CSS File
Positioning
Positioning Schemes:
• Normal Flow (includes relative positioning)
• Floating
• Absolute Position
• Fixed
Position : Normal Flow
Elements rendered in order of normal flow
Position : Relative
At start works just like Normal Flow
To shift box, use :
• top: px, %, auto,inherit;
• bottom: px, %, auto,inherit;
• left: px, %, auto,inherit;
• right: px, %, auto,inherit;
• W.R.T for the flow, the element in its original position.
• When shifted a hole is left in it’s place.
Element is completely removed from document
flow
No effect on next elements
Can overlap other contents
Positioned w.r.t. containing block
To determine position, use :
• top, bottom, left and right
• width and height
Position : Absolute
Position : Fixed
Won’t move with scrolling, always fixed
Not supported by IE 6 or earlier
To determine position, use :
• top, bottom, left and right
• width and height
Position : Floating
float: none | left | right
Floated elements is shifted to one side
Taken out of the normal flow
Can’t float up or down.
Clearing
clear : both | left | right;
To force an element to start below any floated
element
Mainly used to make footer below all floated
column
Note
If position : absolute or floated and width:auto
Generated box shrink to dimension of content
Recommended to set width
If width:100%
don’t use margins, paddings or borders to avoid
overflowing or pushing elements wider than available
Recommended use width : auto and apply margin,
padding and border only
z-index
z-index : number
Is the positioning along the z-index
Larger z-index elements is rendered in front of lower z-
index elements
Can take –ve values
At-rules
Are instructions to the CSS parser
Example:
@import: For importing a css into another
<style>
@import url(‘ /css/mystyle.css’);
@media: Specifies one or more rules to be
applied on a certain media type
</style>
what are media types ?!!
Examples of Media Types:
All:
Suitable for all devices
• Braille
• Embossed
• Handheld (typically small screen, limited bandwidth)
• Print( viewed on screen in print preview mode)
• Screen
@import
Fully supported by FF, Safari, Opera, Chrome, IE 9+
Format :
• @import {URI | string} [media type,…….];
• To import one css into another
• Example: @import url(/css/screen.css)
• Screen
• @import “mobile.css”
• handheld
• Must precede all rule sets, if it follows one/more rule sets it is
ignored
@media
Fully supported by Opera 9.2+, Safary 3+, chrome 2+
Buggy support by IE 6+, FF1+
Format: @media media type,……{ ruleset }
To specify rules to be applied to specific media only
media query
CSS 3 extension to media types, limited support
A logical expression, evaluated to true/false, to
test whether device features to determine whether
to apply the css or no
Used in <link> tag, @import, @media at-rules
CSS is only applied if evaluated to true
<link rel=“stylesheet” type=“text/css”
href=“/style.css” media=“all />
all output media that are capable of color @media
handheld and (min-width:20em){…….}
Handheld devices with width at least 20em
http://reference.sitepoint.com/css/mediaqueries
Examples
ex
Html file
How to create a menu?
DEMO
HTML File
CSS File
References
http://reference.sitepoint.com/css
http://www.w3.org/TR/CSS21/
http://www.w3.org/TR/CSS2/
http://www.w3.org/TR/2011/NOTE-css-2010-
20110512/
https://developer.mozilla.org/en-US/docs/css
http://www.daaq.net/old/css/index.php?
page=using+css
References
http://www.w3.org/TR/html401/
http://www.w3.org/TR/CSS21/
http://www.w3.org/TR/CSS2/
https://developer.mozilla.org/en-US/docs/CSS
http://alistapart.com/articles/howtosizetextincss

More Related Content

What's hot

Introduction to Web Technology
Introduction to Web TechnologyIntroduction to Web Technology
Introduction to Web TechnologyRob Bertholf
 
Introduction to web technology
Introduction to web technologyIntroduction to web technology
Introduction to web technologyVARSHAKUMARI49
 
01. http basics v27
01. http basics v2701. http basics v27
01. http basics v27Eoin Keary
 
CS8651 Internet Programming - Basics of HTML, HTML5, CSS
CS8651   Internet Programming - Basics of HTML, HTML5, CSSCS8651   Internet Programming - Basics of HTML, HTML5, CSS
CS8651 Internet Programming - Basics of HTML, HTML5, CSSVigneshkumar Ponnusamy
 
uniform resource locator
uniform resource locatoruniform resource locator
uniform resource locatorrajshreemuthiah
 
Overview of RESTful web services
Overview of RESTful web servicesOverview of RESTful web services
Overview of RESTful web servicesnbuddharaju
 
Introduction to the World Wide Web
Introduction to the World Wide WebIntroduction to the World Wide Web
Introduction to the World Wide WebAbdalla Mahmoud
 
2009 - Microsoft IIS Vs. Apache - Who Serves More - A Study
2009 - Microsoft IIS Vs. Apache - Who Serves More - A Study2009 - Microsoft IIS Vs. Apache - Who Serves More - A Study
2009 - Microsoft IIS Vs. Apache - Who Serves More - A StudyVijay Prasad Gupta
 
Easy rest service using PHP reflection api
Easy rest service using PHP reflection apiEasy rest service using PHP reflection api
Easy rest service using PHP reflection apiMatthieu Aubry
 
Introducing asp
Introducing aspIntroducing asp
Introducing aspaspnet123
 
Common Gateway Interface
Common Gateway InterfaceCommon Gateway Interface
Common Gateway InterfaceBalu Masulkar
 

What's hot (20)

Webbasics
WebbasicsWebbasics
Webbasics
 
Introduction to Web Technology
Introduction to Web TechnologyIntroduction to Web Technology
Introduction to Web Technology
 
Introduction to web technology
Introduction to web technologyIntroduction to web technology
Introduction to web technology
 
01. http basics v27
01. http basics v2701. http basics v27
01. http basics v27
 
Restful web services
Restful web servicesRestful web services
Restful web services
 
CS8651 Internet Programming - Basics of HTML, HTML5, CSS
CS8651   Internet Programming - Basics of HTML, HTML5, CSSCS8651   Internet Programming - Basics of HTML, HTML5, CSS
CS8651 Internet Programming - Basics of HTML, HTML5, CSS
 
uniform resource locator
uniform resource locatoruniform resource locator
uniform resource locator
 
Overview of RESTful web services
Overview of RESTful web servicesOverview of RESTful web services
Overview of RESTful web services
 
CS6501 - Internet programming
CS6501 - Internet programming   CS6501 - Internet programming
CS6501 - Internet programming
 
Introduction to the World Wide Web
Introduction to the World Wide WebIntroduction to the World Wide Web
Introduction to the World Wide Web
 
2009 - Microsoft IIS Vs. Apache - Who Serves More - A Study
2009 - Microsoft IIS Vs. Apache - Who Serves More - A Study2009 - Microsoft IIS Vs. Apache - Who Serves More - A Study
2009 - Microsoft IIS Vs. Apache - Who Serves More - A Study
 
Easy rest service using PHP reflection api
Easy rest service using PHP reflection apiEasy rest service using PHP reflection api
Easy rest service using PHP reflection api
 
Introducing asp
Introducing aspIntroducing asp
Introducing asp
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
 
Common Gateway Interface
Common Gateway InterfaceCommon Gateway Interface
Common Gateway Interface
 
ASP.NET WEB API
ASP.NET WEB APIASP.NET WEB API
ASP.NET WEB API
 
Rest and Rails
Rest and RailsRest and Rails
Rest and Rails
 
Rest in Rails
Rest in RailsRest in Rails
Rest in Rails
 
Spsl v unit - final
Spsl v unit - finalSpsl v unit - final
Spsl v unit - final
 
Web Technology Fundamentals
Web Technology FundamentalsWeb Technology Fundamentals
Web Technology Fundamentals
 

Similar to Html intake 38 lect1

Introduction to web technology and it's implementation
Introduction to web technology and it's implementationIntroduction to web technology and it's implementation
Introduction to web technology and it's implementationSureshSingh142
 
21. Application Development and Administration in DBMS
21. Application Development and Administration in DBMS21. Application Development and Administration in DBMS
21. Application Development and Administration in DBMSkoolkampus
 
Introduction to Web Architecture
Introduction to Web ArchitectureIntroduction to Web Architecture
Introduction to Web ArchitectureChamnap Chhorn
 
0_Leksion_Web_Servers (1).pdf
0_Leksion_Web_Servers (1).pdf0_Leksion_Web_Servers (1).pdf
0_Leksion_Web_Servers (1).pdfZani10
 
WWW - Lecture 1.pptx
WWW - Lecture 1.pptxWWW - Lecture 1.pptx
WWW - Lecture 1.pptxharoon451422
 
Web Database
Web DatabaseWeb Database
Web Databaseidroos7
 
web services8 (1).pdf for computer science
web services8 (1).pdf for computer scienceweb services8 (1).pdf for computer science
web services8 (1).pdf for computer scienceoptimusnotch44
 
some fundamental topics to remember when starting with HTML
some fundamental topics to remember when starting with HTMLsome fundamental topics to remember when starting with HTML
some fundamental topics to remember when starting with HTMLfaiz324545
 
Nt1310 Final Exam Questions And Answers
Nt1310 Final Exam Questions And AnswersNt1310 Final Exam Questions And Answers
Nt1310 Final Exam Questions And AnswersLisa Williams
 
abdelwahab alsammak_Chapter 1-Internet concepts.ppt
abdelwahab alsammak_Chapter 1-Internet concepts.pptabdelwahab alsammak_Chapter 1-Internet concepts.ppt
abdelwahab alsammak_Chapter 1-Internet concepts.pptDavid319172
 
Server Side Programming
Server Side ProgrammingServer Side Programming
Server Side ProgrammingMilan Thapa
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesWebStackAcademy
 
Web Programming HTML.pptx
Web Programming HTML.pptxWeb Programming HTML.pptx
Web Programming HTML.pptxMarwaAnany1
 
Introduction to web designing
Introduction to web designingIntroduction to web designing
Introduction to web designingRajat Shah
 

Similar to Html intake 38 lect1 (20)

Introduction to web technology and it's implementation
Introduction to web technology and it's implementationIntroduction to web technology and it's implementation
Introduction to web technology and it's implementation
 
21. Application Development and Administration in DBMS
21. Application Development and Administration in DBMS21. Application Development and Administration in DBMS
21. Application Development and Administration in DBMS
 
Introduction to Web Architecture
Introduction to Web ArchitectureIntroduction to Web Architecture
Introduction to Web Architecture
 
Ch-1_.ppt
Ch-1_.pptCh-1_.ppt
Ch-1_.ppt
 
0_Leksion_Web_Servers (1).pdf
0_Leksion_Web_Servers (1).pdf0_Leksion_Web_Servers (1).pdf
0_Leksion_Web_Servers (1).pdf
 
Web Programming introduction
Web Programming introductionWeb Programming introduction
Web Programming introduction
 
WWW - Lecture 1.pptx
WWW - Lecture 1.pptxWWW - Lecture 1.pptx
WWW - Lecture 1.pptx
 
Web Database
Web DatabaseWeb Database
Web Database
 
web services8 (1).pdf for computer science
web services8 (1).pdf for computer scienceweb services8 (1).pdf for computer science
web services8 (1).pdf for computer science
 
some fundamental topics to remember when starting with HTML
some fundamental topics to remember when starting with HTMLsome fundamental topics to remember when starting with HTML
some fundamental topics to remember when starting with HTML
 
Nt1310 Final Exam Questions And Answers
Nt1310 Final Exam Questions And AnswersNt1310 Final Exam Questions And Answers
Nt1310 Final Exam Questions And Answers
 
abdelwahab alsammak_Chapter 1-Internet concepts.ppt
abdelwahab alsammak_Chapter 1-Internet concepts.pptabdelwahab alsammak_Chapter 1-Internet concepts.ppt
abdelwahab alsammak_Chapter 1-Internet concepts.ppt
 
Server Side Programming
Server Side ProgrammingServer Side Programming
Server Side Programming
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services
 
Web Programming HTML.pptx
Web Programming HTML.pptxWeb Programming HTML.pptx
Web Programming HTML.pptx
 
WP Chap 1 & 2.pptx
WP Chap 1 & 2.pptxWP Chap 1 & 2.pptx
WP Chap 1 & 2.pptx
 
Ds
DsDs
Ds
 
C# Unit5 Notes
C# Unit5 NotesC# Unit5 Notes
C# Unit5 Notes
 
Iwt module 1
Iwt  module 1Iwt  module 1
Iwt module 1
 
Introduction to web designing
Introduction to web designingIntroduction to web designing
Introduction to web designing
 

Recently uploaded

Pharma Works Profile of Karan Communications
Pharma Works Profile of Karan CommunicationsPharma Works Profile of Karan Communications
Pharma Works Profile of Karan Communicationskarancommunications
 
Vip Female Escorts Noida 9711199171 Greater Noida Escorts Service
Vip Female Escorts Noida 9711199171 Greater Noida Escorts ServiceVip Female Escorts Noida 9711199171 Greater Noida Escorts Service
Vip Female Escorts Noida 9711199171 Greater Noida Escorts Serviceankitnayak356677
 
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...lizamodels9
 
VIP Call Girls Pune Kirti 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Kirti 8617697112 Independent Escort Service PuneVIP Call Girls Pune Kirti 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Kirti 8617697112 Independent Escort Service PuneCall girls in Ahmedabad High profile
 
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,noida100girls
 
Call Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine ServiceCall Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine Serviceritikaroy0888
 
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...lizamodels9
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...anilsa9823
 
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc.../:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...lizamodels9
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageMatteo Carbone
 
Catalogue ONG NUOC PPR DE NHAT .pdf
Catalogue ONG NUOC PPR DE NHAT      .pdfCatalogue ONG NUOC PPR DE NHAT      .pdf
Catalogue ONG NUOC PPR DE NHAT .pdfOrient Homes
 
Progress Report - Oracle Database Analyst Summit
Progress  Report - Oracle Database Analyst SummitProgress  Report - Oracle Database Analyst Summit
Progress Report - Oracle Database Analyst SummitHolger Mueller
 
Sales & Marketing Alignment: How to Synergize for Success
Sales & Marketing Alignment: How to Synergize for SuccessSales & Marketing Alignment: How to Synergize for Success
Sales & Marketing Alignment: How to Synergize for SuccessAggregage
 
Tech Startup Growth Hacking 101 - Basics on Growth Marketing
Tech Startup Growth Hacking 101  - Basics on Growth MarketingTech Startup Growth Hacking 101  - Basics on Growth Marketing
Tech Startup Growth Hacking 101 - Basics on Growth MarketingShawn Pang
 
rishikeshgirls.in- Rishikesh call girl.pdf
rishikeshgirls.in- Rishikesh call girl.pdfrishikeshgirls.in- Rishikesh call girl.pdf
rishikeshgirls.in- Rishikesh call girl.pdfmuskan1121w
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMRavindra Nath Shukla
 
GD Birla and his contribution in management
GD Birla and his contribution in managementGD Birla and his contribution in management
GD Birla and his contribution in managementchhavia330
 
Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝soniya singh
 

Recently uploaded (20)

Pharma Works Profile of Karan Communications
Pharma Works Profile of Karan CommunicationsPharma Works Profile of Karan Communications
Pharma Works Profile of Karan Communications
 
KestrelPro Flyer Japan IT Week 2024 (English)
KestrelPro Flyer Japan IT Week 2024 (English)KestrelPro Flyer Japan IT Week 2024 (English)
KestrelPro Flyer Japan IT Week 2024 (English)
 
Vip Female Escorts Noida 9711199171 Greater Noida Escorts Service
Vip Female Escorts Noida 9711199171 Greater Noida Escorts ServiceVip Female Escorts Noida 9711199171 Greater Noida Escorts Service
Vip Female Escorts Noida 9711199171 Greater Noida Escorts Service
 
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
 
VIP Call Girls Pune Kirti 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Kirti 8617697112 Independent Escort Service PuneVIP Call Girls Pune Kirti 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Kirti 8617697112 Independent Escort Service Pune
 
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
 
Call Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine ServiceCall Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine Service
 
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
 
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
 
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc.../:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
 
Catalogue ONG NUOC PPR DE NHAT .pdf
Catalogue ONG NUOC PPR DE NHAT      .pdfCatalogue ONG NUOC PPR DE NHAT      .pdf
Catalogue ONG NUOC PPR DE NHAT .pdf
 
Progress Report - Oracle Database Analyst Summit
Progress  Report - Oracle Database Analyst SummitProgress  Report - Oracle Database Analyst Summit
Progress Report - Oracle Database Analyst Summit
 
Sales & Marketing Alignment: How to Synergize for Success
Sales & Marketing Alignment: How to Synergize for SuccessSales & Marketing Alignment: How to Synergize for Success
Sales & Marketing Alignment: How to Synergize for Success
 
Tech Startup Growth Hacking 101 - Basics on Growth Marketing
Tech Startup Growth Hacking 101  - Basics on Growth MarketingTech Startup Growth Hacking 101  - Basics on Growth Marketing
Tech Startup Growth Hacking 101 - Basics on Growth Marketing
 
rishikeshgirls.in- Rishikesh call girl.pdf
rishikeshgirls.in- Rishikesh call girl.pdfrishikeshgirls.in- Rishikesh call girl.pdf
rishikeshgirls.in- Rishikesh call girl.pdf
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSM
 
GD Birla and his contribution in management
GD Birla and his contribution in managementGD Birla and his contribution in management
GD Birla and his contribution in management
 
Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝
 

Html intake 38 lect1

  • 2. 2 We need to answer… …How is the Internet organised? …How do we find and retrieve pages on the Internet? …How is this data (web pages, etc) transmitted over the Internet? …How is what we see in the browser window defined as a collection of data? http://www.user-agents.org/
  • 3. 3 Clients and Servers The Web is a client/server application: Web browsers are clients which send requests to Web servers, which send responses back.
  • 4. 4 Fetching Pages over the Internet Architecturally, the Internet consists of a collection of layers, each one providing services for the one above it: The Internet Layer gets packets to their destinations; The Transport Layer sends streams of data; The Application Layer provides high-level services to applications such as Web browsers.
  • 5. 5 HTTP HTTP makes use of TCP to open connections between clients and servers and to pass the requests and responses between them. When a user clicks a link or types a web address: 1. A TCP connection is opened between browser and server 2. Then requests and responses are sent back and forth using HTTP HTTP is a stateless protocol, meaning each request for data is dealt with in isolation; once the server sends the response, it forgets everything about the original request.
  • 6. 6 Fetching Pages over the Internet: HTTP / response HTTP Hypertext Transfer Protocol TCP Transmission Control Protocol IP Internet Protocol
  • 7. 7 HTTP in Context Major steps in a "browser process" Client Origin server HTML http://origin/..http://origin/.. DNS server DNS query Establish TCP connection HTTP request Optional parallel connections HTTP response HTTP transaction
  • 8. 8 Uniform Resource Locators (URLs) Without a universal addressing mechanism, it would be impossible to navigate to a site, and page linking would not be feasible Uniform Resource Locators (URLs) are used to identify Web pages — basically a URL is a web address URLs have 3 components: A Prefix (usually http:// ) A Hostname: (such as www.cityu.edu.hk) A Path: (such as /scm/index.htm)
  • 9. 9 Uniform Resource Locators (URLs) Example: http://www.cityu.edu.hk/scm/index.htm Prefix The transfer protocol required to request data from the server Host name Identifies a particular computer somewhere on the Internet Path Identifies a file within a hierarchical directory structure on the server
  • 10. 10 Uniform Resource Locators (URLs) Example: http://www.cityu.edu.hk/scm/index.htm Prefix The transfer protocol required to request data from the server Host name Identifies a particular computer somewhere on the Internet Path Identifies a file within a hierarchical directory structure on the server
  • 11. 11 IP Addresses and DNS Every computer connected to the Internet must have a unique IP address, no matter whether it’s a client or a server (or both) An IP address is just a number that identifies a host on the Internet. Example: 212.171.218.34 or 144.214.5.218 The Domain Name System (DNS) is a database that matches IP addresses to host names
  • 12. 12 Domain Names And the Domain Name System (DNS) translates host names into IP addresses, which are then used by TCP to establish connections between HTTP clients and servers. Domain names are administered in such a way that they are guaranteed to be unique. Domain names are organised in a hierarchical structure…. Internet Corporation for Assigned Names and Numbers (ICANN) https://www.icann.org/
  • 13. 13 Top Level Domains www.cityu.edu.hk www.cityu.hk www.apple.com Top Level Domain (TLD) Mostly country domains: .uk, .au, .hk, etc. Generic Top Level Domain (gTLD) .com .org .net .biz .info .name .ws .tv(.edu, .gov, .mil restricted to US only)
  • 14. 14 Second Level Domains www.cityu.edu.hk www.cityu.hk www.apple.com The actual name of the organisation or service. Can contain letters (a to z), numbers (0 to 9), dashes ( - )
  • 15. 15 Third Level, or Sub Domains www.cityu.edu.hk sweb.cityu.edu.hk www.apple.com store.apple.com seminars.apple.com Strings of characters that designate different services, or hosts within the second level domain. E.G. “www” for the core or main website, “sweb” for SCM’s sub-network within CityU.
  • 16. SM5312 week 5: web technology basics 16 http://www.cityu.edu.hk/scm/index.htm Paths Prefix The transfer protocol required to request data from the server Host name Identifies a particular computer somewhere on the Internet Path Identifies a file within a hierarchical directory structure on the server
  • 17. 17 Home Page Naming For… http://www.cityu.edu.hk …there must be a default HTML page that is displaying as the home page. In the case of CityU, it is… http://www.cityu.edu.hk/index.html …meaning index.html is the default HTML page in the root directory of the server.
  • 18. 18 Home Page Naming Web servers will automatically serve up pages file-named index.html index.htm default.htm default.html …as long as ONE page by those filenames resides in the root directory of your site. If you want to use a page by another name as the home page of the site, you will have to configure the server software to point to that page.
  • 19. 19 Web Page Naming (HTML naming Conventions) All lower-case, no spaces, no special characters [other than dash ( - ) or underscore ( _ ) ]. products.html Products.html products_sept07.html products sept/07.html The same applies to the name of folders and sub- folders within your site. recommended ok, but not recommended (esp. in XHTML) recommended not recommended
  • 20. Technologies Overview Client Side Technologies HTML, CSS, JavaScript XHTML, DHTML, AJAX, HTML5,FLASH Server Side Technologies ASP, PHP, Perl, JSP, Node JS ASP.NET, Java,C++,C# MySQL, SQL Server, Access
  • 21. Technologies Overview Some More Advanced Technologies XML, XSLT, RSS, Atom X-Path, XQuery, WSDL XML-DOM, RDF Ruby on Rails, GRAIL Framework REST, SOAP
  • 22. 22
  • 23. 23
  • 24. The publishing language used by the World Wide Web is HTML (from Hyper-text Markup Language). Documents Document = page = HTM file = topic Content (text, images) Tags (display commands) HTML (Hyper-text Markup Language)
  • 25. That’s how this… <html> <head><title>Welcome onboard</title></head> <body bgcolor=“#f4f4f4"> <h1>Welcome</h1> <img src=“dcetech.gif" width=“222" height=“80" alt=“DCETECH" BORDER="0“ /> <h2>A Message from the Speaker </h2> <p><font color=red>Good evening! Thank you for coming here!</font></p> <p>Hello and welcome to Web technologies workshop! I'm <b>Ankit Jain,</b>, 4th year Computer Engg <a href=“http://dcetech.com"> Head DCETECH.COM </a>. Dcetech is a student portal and only one of its kind in India.It is not only a technical oriented site which caters only for engineers but its for students from any background! Also students from any educational institution can register and join Dcetech. </p> . . . </body> </html>
  • 27. An HTML page is a tree of html elements HTML Elements
  • 28. Begin with a (<); end with a (>) Most tags are paired into beginning and ending tags; for example, <b>Hello</b> world Hi <i>Ahmed</i> Ali <hr><br> <b><i>Hello</i></b> world HTML Tags
  • 29. Some HTML Tags example START TAG END TAG <HTML> </HTML> <HEAD> </HEAD> <TITLE> </TITLE> <BODY> </BODY> <H1>, <H2>, ... </H1>, </H2>, ... <IMG ...> </IMG> (optional) <A ...> </A> <P> </P> <BR/> (none; "empty" tag) <OL> </OL> <UL> </UL> <LI> </LI>
  • 30. Basic Structure of HTML document Example of basic tag positioning <html> <head> <title>Title bar text</title> </head> <body> <p>Look, I'm a paragraph!</p> </body> </html>
  • 31. <html> <head> <title> Introduction to web development </title> </head> <body> <p>Welcome to HTML!</p> </body> </html> Basic Structure Title tags Body tags
  • 32. 32 What Comes in the Head Optional elements <html> <head> <title>Title</title> <base href="..."> Path for relative URLs <script>...</script> Embedded script program <style>...</style> Cascading style sheet <link...> File associations <meta...> Document information <meta Name=“P. Michiardi” Content=“Lecture 1”> </head> <body> </body> </html>
  • 33. Meta tags are used to store information usually relevant to browsers and search engines. <META name="DESCRIPTION" content="AN HTML Tutorial"> <META name="KEYWORDS" content="html, webdesign, javascript"> <META name="GENERATOR" content="Frontpage 3.0"> <META name="AUTHOR" content="Bill Gates"> <META http-equiv="REFRESH" content="5; url=http://www.echoecho.com"> <META http-equiv=“expires" content=“Sun, 31 Jan 2005 17:35:00 GMT "> Meta tag
  • 34. <body bgcolor=“#FFFFFF” link="#C0C0C0" vlink="#808080" alink="#FF0000“> attributes of body section : link vlink alink Bgcolor Background Bgproperties fixed Topmargin / leftmargin / bottommargin / rightmargin Body Section
  • 35. Text Formatting Resizing Layout Listing Images Inserting images (GIF and jpg) Adding a link to an image Links To local pages To pages at other sites To bookmarks Tags inside BODY SECTION • Background • Colors • Images • Fixed Images • Tables • Frames • Forms
  • 36. TEXT FORMAT <b>text</b> writes text as bold <i>text</i> writes text in italics <u>text</u> writes underlined text <sub>text </sub> lowers text and makes it smaller <sup>text </sup> lifts text and makes it smaller <blink>text</blink> guess yourself! (Note: Netscape only.) <strike>text</strike> strikes a line through the text <pre>text</pre> writes text exactly as it is, including spaces. <strong>text<strong> makes text bold
  • 37. TEXT SIZE These are the tags for changing the font size. <big>text</big> increase the size by one <small>text</small> decrease the size by one <h1>text</h1> writes text in biggest heading <h6>text</h6> writes text in smallest heading <font size="1">text</font> writes text in smallest font size. (8 pt) <font size="7">text</font> writes text in biggest font size (36 pt)
  • 38. TEXT LAYOUT <p>text</p> Adds a paragraph break after the text. (2 linebreaks). <p align="left">text</p> Left justify text in paragraph. <p align="center">text</p> Center text in paragraph. <p align="right">text</p> Right justify text in paragraph. text<br> Adds a single linebreak where the tag is. <nobr>text</nobr> Turns off automatic linebreaks - even if text is wider than the window. <center>text</center> Center text. <div align="center">text</div> Center text. <div align="left">text</div> Left justify text. <div align="right">text</div> Right justify text.
  • 39. Images types used in browsers are : GIF & JPG <img src="http://www.haneen.com.eg/logo.gif"> <img src="logo.gif"> Resizing <img src=“logo.gif" width="60" height="60"> HTML Images
  • 40. SPACING AROUND <img src="rainbow.gif" Hspace="30" Vspace="10"> ALIGNMENT OF IMAGES You can align images according to the text around it Default, left, right, top, texttop, middle, center ALTERNATIVE TEXT <img src=“logo.gif" alt="This is a text that goes with the image"> HTML Images
  • 41. Possible shapes for areas inside image are <area shape=rect coords= x1,y1, x2,y2 Href="http://www.domain.com"> <area shape=circle coords= x1,y1, x2,y2 Href="http://www.domain.com"> <area shape=polygon coords= x1,y1, x2,y2, .., xn,yn Href="http://www.domain.com"> Example <img src="rainbow.gif" usemap = #example border=0> <map name=example> <area shape=Rect Coords=0,0,29,29 Href="http://www.yahoo.com"> <area shape=Rect Coords=30,30,59,59 Href="http://www.hotbot.com"> </map> Image map
  • 42. Click <a href="http://www.yahoo.com">here</a> to go to yahoo. COLORS ON TEXT LINKS <body link="#C0C0C0" vlink="#808080" alink="#FF0000"> LINK TARGETS <a href="http://www.yahoo.com" target="_blank"> HTML Links
  • 43. Image link <a href="myfile.htm"><img src="rainbow.gif"></a> <a href="myfile.htm"><img src="rainbow.gif" border="0"></a> Link to email <a href="mailto:youremailaddress">Email Me</a> <a href="mailto:email@hotmail.com?subject=SweetWords">Send Email</a> <a href="mailto:email@hotmail.com?body=Please send me a copy of your new program!">Send Email</a> <a href="mailto:email@hotmail.com?subject=SweetWords &body=Please send me a copy of your new program!">Email Me</a> HTML Links
  • 44. LINK WITHIN A PAGE To link to an anchor you need to: • Create a link pointing to the anchor • Create the anchor itself. 1.<a name="chapter4"></a> 2.Click <a href="#chapter4">here</a> to read chapter 4. When you link to anchors on external pages use this syntax <a href="http://www.yahoo.com#YahoosAnchor">blabla</a> HTML Links (cont.)
  • 45. BULLETED LISTS You have the following bullet options: disc circle square <ul> <li>text</li> <li>text</li> <li>text</li> </ul> <ul type="disc"> <ul type="circle"> <ul type="square">
  • 46.  You have the following number options: ◦Plain numbers <ol> ◦Capital Letters <ol type="A"> ◦Small Letters <ol type="a"> ◦Capital Roman Numbers <ol type="I"> ◦Small Roman Numbers <ol type="i"> <ol> <li>text</li> <li>text</li> <li>text</li> </ol> <ol start="5"> NUMBERED LISTS
  • 48. A web page, broken down Web Browser Content/Data UI Logic Styling Rules Website
  • 49. A web page, broken down Web Browser HTML JavascriptCSS Website
  • 50. HTML Tag Structure <textarea rows="4" cols="30"> blah blah blah </textarea> Tag (Element) name Attribute name Attribute value Tag contents
  • 52. Hexadecimal Colors R G B #000000 00 = 0 FF = 255
  • 53. Hexadecimal Colors R G B #000000 16^6 = 16,777,216 possible colors
  • 56. 56
  • 57. HTML Forms Used to send data back to the server to be processed. <form></form> Contains: control elements that get data from the user label elements Attributes: • action url of page where data is sent • method GET/POST http request method
  • 58. Form - controls Controls must have name and value attributes to be submitted. Controls can be disabled using disabled attribute. Each control has an initial value and a current value.
  • 59. Form- Control Types Buttons: To submit form: • <input type=“submit” /> • <button type=“submit”></button> To reset form: • <input type=“reset” /> • <button type=“reset”></button> Just a button with no default behavior • <input type=“button” /> • <button type=“button”></button>
  • 60. Checkboxes: On/off switches • More than one can share the same name to allow to select several values • Checked attribute is set to make initial value “on” • <input type=“checkbox”/> Form- Control Types
  • 61. TextBox: Single line text input • <input type=“text”/> Password: Similar to TextBox, but input text is rendered as a series of asterisks or similar characters But submitted as plain clear text • <input type=“password” /> Form- Control Types
  • 62. RadioButtons: On/off switches but are mutually exclusive More than one share the same name to create a mutually exclusive group Checked attribute is set to make initial value “on” • <input type=“radio”/> Form- Control Types
  • 63. DropDown Lists/Menus: To choose one/more from multiple options • <select name=“……”></select> To select multiple options use multiple attribute • <select name=“……” multiple></select> To define items use • <option></option> Option can have name, value and selected attributes Form- Control Types
  • 64. DropDown Lists/Menus: To logically group options use optgroup • <optgroup label=“…..”></optgroup> • http://www.w3schools.com/tags/tryit.asp? filename=tryhtml_optgroup Label attribute is the value that appears in the list Form- Control Types
  • 65. File select: Allow users to select files to be submitted to a form • <input type=“file” /> Form- Control Types
  • 66. Hidden controls: Not rendered visually Values are submitted with the other form data Can help overcome stateless nature of HTTP • <hidden name=“… ” value=“… ” /> Form- Control Types
  • 67. Textarea controls: Multiline text input Value is the content nested in the control • <textarea>Content </textarea> • Has rows and cols attributes to set size of textarea. Form- Control Types
  • 68. Label Specify a label for controls that don t have an implicit‟ label For attribute MUST match ID value of the control attached to it Useful for speech synthesizers readers • <label for=“fname”>First Name :</label> Form- Control Types
  • 69. Structuring Form Use <fieldset> and <legend> to group related controls and labels
  • 70. Block vs. Inline Elements Inline Block No newlines before or after it Newlines appears before and after it.  Page flow is not broken  Has no width and height Can have a width and height Takes as much width of the page as the content  Takes the whole page width Can contain only inline elements Can contain inline or block elements Examples:<span>, <a>, <img >, <b>, <em>,<input< Examples:<p>, <div<
  • 72. CSS Cascade Style Sheets (CSS)  Cascading = styling rules "cascade“  From parent tags to child tags  Rules can override others Style = style Sheet = file
  • 73. Basic CSS Structure ( tag name/class/id) { (rule); (rule); ... }
  • 74. CSS Rules Syntax Example Body { background-color:blue; color:white; font-size:24pt; property1: value1; property2: value2; } p { property: value3; color:yellow;
  • 75. Where to add CSS? Inline style attribute Applied to a single element • <p style=“color : pink ; font-size : 30pt ;” In <head> Applied to an entire single page • <head> <style> body{ font-family : arial ; background-color : black ; color : white ; } p { color : pink ; } </style> </head>
  • 76. In external sheet (.css) Applied to any html file linked to it • <head> <link rel=“stylesheet” type=“text/css” href=“style.css” /> </head> Where to add CSS?
  • 77. CSS Selectors Simple Selectors • element, class, ID • Select by name of element (h1, p, div, span, …..etc. Example: p { font-size:20pt; } Group Selectors coma-separated list of selectors
  • 78. Class Selector Select an element by the class attributes defined Class is an attribute of most html elements, specifies one or more class names (space- separated list) Example: .maincontent /*select any element with class=“maincontent” */ H1.headerTitle { font-size : 20pt; } /*select the all h1 with class=“headerTitle” */ .x { color : red; }
  • 79. ID Selector Select an element by the ID attributes defined ID is an attribute of all html elements, it must be unique throughout a certain html page Example: #maincontent /*select the element with id=“maincontent” */ { font-size : 20pt; } h1#headerTitle /*select the only h1 with id=“headerTitle” */ #x { color : red; }
  • 80. Attribute Selector Select an element by the attributes defined in it Example: [href] /*select any element with attribute named href*/ { font-size : 20pt ; } h1[title] /*select any h1 element with title attribute defined */ { color : red ; } a[href =“ http: //www. Google .com”] /*select any a element with href exactly equal http://www.google.com */ { color : blue ; }
  • 81. Combinatory This selectors specified by relation between elements Descendant Direct Childof (>) Adjacent Sibling (+) General Sibling(~) Examples: • h1 strong {……..} /*strong descendant of h1 i.e. inside */ • div ol > li p{…….} /*p descendant of li which is a direct child of ol which is a descendant of div*/ • span + p {……..} /*p that is a direct adjacent sibling to a span*/ • a~p{………} /*p that is sibling of a it may be adjacent or not*/
  • 82. Colors #-hexadecimal rgb() and rgba() hsl() and hsla() To get full list of color keywords: http://www.w3schools.com/colors/colors_picker.asp http://www.colorcombos.com/
  • 83. Units in CSS pixel (px) absolute value em: ratio of context size relative to surrounding text percentage: percentage of context size
  • 84. CSS Text Formatting color: name|#hex|rgb()|rgba()|hsl()|hsla(); /*foreground color*/ letter-spacing: normal|length (px,%,em); line-height: normal|number|length|percentage; text-align: left|right|center|justify; text-decoration: none|underline|overline|line- through|blink;
  • 85. text-indent: length|percentage; text-transform: capitalize|uppercase|lowercase|none; text-shadow: rightpx bottompx blurpx color; direction: ltr | rtl; text-indent: length|percentage; text-transform: capitalize|uppercase|lowercase|none; text-shadow: rightpx bottompx blurpx color; direction: ltr | rtl; CSS Text FormattingCSS Text Formatting
  • 86. CSS Font  font-family :list of fontnames to chose from font-style: normal|italic|obliquefont-variant: normal| small-caps font: font-family font-size font-weight font-style font-variant
  • 87. @font-face { font-family: 'YourFontName'; /*a name to be used later*/ src: url('http://domain.com/fonts/font.ttf'); /*URL to font*/ } Then, trivially, to use the font on a specific element: .classname { font-family: 'YourFontName'; } https://fonts.google.com/ Use @font-face
  • 88. Background formatting background-attachment : scroll | fixed; background-color : color; background-image : none/url (path); background-position : percent|length| (top left right bottom center) background-repeat : repeat | repeat-x| |repeat-y|no-repeat background-size : length|percentage|
  • 89. Selection based on parts of elements Identified by ::first-letter ::before ::after ::first-line ex: • p::after { content : ”this content is added after the p” color:red; } PseudoElement Selector
  • 91. Pseudo Class Selector Selection based on special effects, Identified by ”:” Link: • :visited, :target User actions: • :hover, :active, :focus UI elements states: • :enabled, :disabled, :checked Structural : • :first-child, :last-child, :nth-child(), :empty, :not()
  • 92. Pseudo Class Selector (Cont. d)‟ Example: a:hover { font-size:20pt; } /*applied when mouse hover over any link */ a.red:hover { font-size:20pt; } /*applied when mouse hover over link with class=“red” */ Input[type=“text”]:disabled { color:red; } /*applied to any textbox which is disabled */
  • 93. Visual Formatting and LayoutVisual Formatting and Layout
  • 94. CSS layout and formatting After parsing the html into a document tree (DOM) Each node is rendered as one or more rectangular boxes Types of Boxes: Block Boxes : • For block elements ex. div, p • Elements with display : block| list-item| table Inline Boxes: • For inline elements ex. span, b, em • Elements with display : inline | inline-table | inline-block;
  • 95. Block vs. Inline Elements Inline Block No newlines before or after it Newlines appears before and after it.  Page flow is not broken  Has no width and height Can have a width and height Takes as much width of the page as the content  Takes the whole page width Can contain only inline elements Can contain inline or block elements Examples:<span>, <a>, <img >, <b>, <em>,<input< Examples:<p>, <div<
  • 96. The BOX Model Applied to block level elements
  • 97. Applies to block-level elements Overall dimension of element = Height/width + padding + border + margin BOX Model .box { width:300px; height:200px; padding:10px; margin:15px; border: 1px solid #000; }
  • 98. How to center a block? Centered Text HTML File CSS File
  • 99. Positioning Positioning Schemes: • Normal Flow (includes relative positioning) • Floating • Absolute Position • Fixed
  • 100. Position : Normal Flow Elements rendered in order of normal flow
  • 101. Position : Relative At start works just like Normal Flow To shift box, use : • top: px, %, auto,inherit; • bottom: px, %, auto,inherit; • left: px, %, auto,inherit; • right: px, %, auto,inherit; • W.R.T for the flow, the element in its original position. • When shifted a hole is left in it’s place.
  • 102. Element is completely removed from document flow No effect on next elements Can overlap other contents Positioned w.r.t. containing block To determine position, use : • top, bottom, left and right • width and height Position : Absolute
  • 103. Position : Fixed Won’t move with scrolling, always fixed Not supported by IE 6 or earlier To determine position, use : • top, bottom, left and right • width and height
  • 104. Position : Floating float: none | left | right Floated elements is shifted to one side Taken out of the normal flow Can’t float up or down.
  • 105. Clearing clear : both | left | right; To force an element to start below any floated element Mainly used to make footer below all floated column
  • 106. Note If position : absolute or floated and width:auto Generated box shrink to dimension of content Recommended to set width If width:100% don’t use margins, paddings or borders to avoid overflowing or pushing elements wider than available Recommended use width : auto and apply margin, padding and border only
  • 107. z-index z-index : number Is the positioning along the z-index Larger z-index elements is rendered in front of lower z- index elements Can take –ve values
  • 108. At-rules Are instructions to the CSS parser Example: @import: For importing a css into another <style> @import url(‘ /css/mystyle.css’); @media: Specifies one or more rules to be applied on a certain media type </style>
  • 109. what are media types ?!! Examples of Media Types: All: Suitable for all devices • Braille • Embossed • Handheld (typically small screen, limited bandwidth) • Print( viewed on screen in print preview mode) • Screen
  • 110. @import Fully supported by FF, Safari, Opera, Chrome, IE 9+ Format : • @import {URI | string} [media type,…….]; • To import one css into another • Example: @import url(/css/screen.css) • Screen • @import “mobile.css” • handheld • Must precede all rule sets, if it follows one/more rule sets it is ignored
  • 111. @media Fully supported by Opera 9.2+, Safary 3+, chrome 2+ Buggy support by IE 6+, FF1+ Format: @media media type,……{ ruleset } To specify rules to be applied to specific media only
  • 112. media query CSS 3 extension to media types, limited support A logical expression, evaluated to true/false, to test whether device features to determine whether to apply the css or no Used in <link> tag, @import, @media at-rules CSS is only applied if evaluated to true
  • 113. <link rel=“stylesheet” type=“text/css” href=“/style.css” media=“all /> all output media that are capable of color @media handheld and (min-width:20em){…….} Handheld devices with width at least 20em http://reference.sitepoint.com/css/mediaqueries Examples
  • 115. How to create a menu? DEMO HTML File CSS File

Editor's Notes

  1. default aligns the image using the default settings of the Web browser. Same as baseline. left aligns the image in the left margin and wraps the text that follows the image. right aligns the image in the right margin and wraps the text that precedes the image. top aligns the top of the image with the surrounding text. texttop aligns the top of the image with the top of the tallest text in the line. middle aligns the middle of the image with the surrounding text. absmiddle aligns the image with the middle of the current line. baseline aligns the image with the baseline of the current line. bottom aligns the bottom of the image with the surrounding text. absbottom aligns the image with the bottom of the current line. center aligns the center of the image with the surrounding text.
  2. default aligns the image using the default settings of the Web browser. Same as baseline. left aligns the image in the left margin and wraps the text that follows the image. right aligns the image in the right margin and wraps the text that precedes the image. top aligns the top of the image with the surrounding text. texttop aligns the top of the image with the top of the tallest text in the line. middle aligns the middle of the image with the surrounding text. absmiddle aligns the image with the middle of the current line. baseline aligns the image with the baseline of the current line. bottom aligns the bottom of the image with the surrounding text. absbottom aligns the image with the bottom of the current line. center aligns the center of the image with the surrounding text.
  3. What is the content? What does it look like? How does it function?