Professional Documents
Culture Documents
Client Server
I would like to open a
connection
OK
Display response
Close connection
OK
HTTP is the set of rules governing the format and content of the
conversation between a Web client and server
An HTTP example
The message requesting a Web page must begin with the work
“GET” and be followed by a space and the location of a file on the
server, like this:
GET /fac/lpress/shortbio.htm
The protocol spells out the exact message format, so any Web
client can retrieve pages from any Web server.
Network protocols
Tim Berners-Lee was knighted by Queen Elizabeth for his invention of the World
Wide Web. He is shown here, along with the first picture posted on the Web and a
screen shot from an early version of his Web browser.
HTTP is an application layer protocol
The Web client and the Web server are application programs
Application layer programs do useful work like retrieving Web
pages, sending and receiving email or transferring files
Lower layers take care of the communication details
The client and server send messages and data without knowing
anything about the communication network
The application layer is boss – the top
layer
Layer Function
Application Do useful work like Web browsing, email,
and file transfer
Your boss says: Send this package to Miami -- I don't care if you use Federal
Express, UPS, or any other means. Also, let me know when it arrives or if it
cannot be delivered for some reason.
The application program says: Send this request to the server -- I don't care
how you do it or whether it goes over phone lines, radio, or anything else
about the details. Just send the message, and let me know when it arrives
or if it cannot be delivered for some reason.
There are five TCP/IP layers, the application layer and four lower layers.
Many application layer protocols are
used on the Internet, HTTP is only one
Protocol Application
SGML
XML
RS XHTML SV HTML
S G
XML Example
• XML Declaration
• One root-‐element
• Every tag is opened and ended
• Att ributes inside “ ”
• Case sensitivity
XML Example
<?xml version=“1.0” encoding=“utf-8”?>
<!DOCTYPE books SYSTEM “books.dtd”>
<books>!
<book id=“A01”>
<title>Designing Web Usability</title>
<author>Jakob Nielsen</author>
<book>
</books>
DTD Example: books.dtd
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
>
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
<title>XHTML 1.0 Example</title>
</head>
<body>
<p>This is a example.</p>
</body>
</html>
General Form
• XHTML consists of
– Xml-‐declaration
– Document type
– XHTML ‐-document
• head
• body
XHTML Basic Structure
• <ul>
• <li>Carrot</li>
<li> Tomato</li>
</ul>
Commen)ng
• Compulsary: ti t l e
• Meta-‐informati on
– See:
hS p ://www.cs.tut.fi/~jkorpela/webjulk/1.6.h
tml
• Possible linking to stylesheets
Text ‐-elements
• p • tr td
• br • i
• blockquot • b
e • big
• pre • small
• em • sub
• strong • sup
• code
Lists
• See:
– hS p ://www.cs.tut.fi/~jkorpela/webjulk/1.5.h
tml
• Link to outside
– <a href="hS p ://www.tamk.fi">tamk</a>
• Link within page
– <a href=”dog.html">Dog</a>
Images
<table>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</
td>
<td>cell</
td>
</tr>
</table>
Table: Heading
<table>
<tr>
<th>Name</th>
<th>Telephone</th>
<th>Telephone</th>
</tr>
<tr>
<td>Bill
Gates</td>
<td>555 77
854</td>
<td>555 77
855</td>
</tr>
</
table>
Combining Rows and Cols
<table>
<tr>
<td
colspan="3">Title</td>
</tr>
<tr>
<td>Title</td>
<td colspan="2">cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
<td>cell</td>
</tr>
</table>
CASCADING STYLE
SHEETS
Ce este CSS?
<HTML>
<HEAD>
<TITLE>Buna dimineata A02!</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="sheet1.css" />
<STYLE TYPE="text/css">
@import url(sheet2.css);
BODY {background: yellow;}
</STYLE>
</HEAD>
<BODY>
<H1>Brrrrr!</H1>
<P STYLE="color: gray;">A02 este cel mai mare frigider de pe
suprafata pamantului.
</P>
</BODY>
</HTML>
Folosirea CSS in HTML cont.
Informatia CSS poate fi specificata in 3 locuri/moduri:
●In anumite taguri din "body"-ul documentului HTML
<P STYLE="color: gray;">A02 ....
●In fisiere css comune mai multor documente HTML Foi de stil externe
<LINK REL="stylesheet" TYPE="text/css" HREF="sheet1.css"
TITLE="Default" MEDIA="all">
Tag-ul LINK
● Referinta la o foaie de stil externa
<LINK REL="stylesheet" TYPE="text/css" HREF="sheet1.css"
TITLE="Default">
● Scopul de baza - sa permita asocierea altor documente
cu documentul HTML
● CSS il foloseste pentru a asocia foi de stil cu HTML
● Trebuie folosit in cadrul sectiunii HEAD
● O foaie de stil poate fi comuna mai multor documente
HTML
Atributele tag-ului LINK
Atribute obligatorii
● TYPE descrie tipul de date din documentul referit (in cazul css este
intodeauna: "text/css")
●HREF specifica un URL cu locatia foii de stil Atribute
optionale
● REL -
"relatie
",
stylesh
eet"
● TITLE folosit pentru cazurile cand sunt incarcate mai multe foi de stil intr-
o pagina
● MEDIA specifica mediumul pt care va fi folosit CSS.
(e.g. monitor, proiector, imprimanta, IPhone)
Tag-ul STYLE
● Stilurile definite de tag-ul STYLE sunt denumite si "document
style sheet" sau "embedded style sheet"
<STYLE TYPE="text/css">
@import url(sheet2.css);
H1 {color: maroon;}
BODY {background: yellow;}
</STYLE>
Stiluri inline
Folosirea ID selector
<p id="copyright">…
Pseudo-Classes
● Permite asocierea de stiluri la structuri care nu exista in
document
● CSS1, pune la dispozitie 3 pseudo-classes:
○ :link - se refera la orice tag care contine un hyperlink care
indica o adresa ce nu a fost vizitata
○ :visited - la fel ca mai sus dar catre o adresa deja
vizitata
○ :active - orice tag ce contine hyperlink si care este in
proces de a fi activat (click sau similar)
○ :hover - permite modificarea aparentei unui hyperlink
atunci cand cursorul trece peste el.
Folosirea pseudo-classes
Exemplu:
● H1 va fi cu
font-size 13pt
● EM va fi cu
font-size 13pt
Limitari ale mostenirii