22
DNS – HTTP – DHTML - CSS ICW Lecture 5 Hasan Qunoo

DNS – HTTP – DHTML - CSS ICW Lecture 5 Hasan Qunoo

  • View
    224

  • Download
    0

Embed Size (px)

Citation preview

Page 1: DNS – HTTP – DHTML - CSS ICW Lecture 5 Hasan Qunoo

DNS – HTTP – DHTML - CSS

ICW Lecture 5Hasan Qunoo

Page 2: DNS – HTTP – DHTML - CSS ICW Lecture 5 Hasan Qunoo

DNS - Domain Name System

School of Computer ScienceThe University of BirminghamEdgbastonBirminghamB15 2TTUnited Kingdom

.uk

.ac

.bham

.cswww

Page 3: DNS – HTTP – DHTML - CSS ICW Lecture 5 Hasan Qunoo

DNS - Domain Name System

• Everyone has used a DNS. • The DNS system forms one of the largest and

most active distributed databases on the planet.• a hierarchical, domain-based naming scheme and

a distributed database system for implementing this naming scheme.

• Every machine on the Internet has its own IP address. Some static and some dynamic.

• An IP address is all that you need to talk to a server.

• Domain names are strictly a human convenience.

Page 4: DNS – HTTP – DHTML - CSS ICW Lecture 5 Hasan Qunoo

DNS - Domain Name System

• The DNS system is a database• It translates symbolic hostnames into

the numerical IP addresses.

Example:

www.cs.bham.ac.uk  147.188.192.42

www.bham.ac.uk  147.188.125.57

www.google.com 74.125.43.105• A single URL can be resolved into more

than one IP. (Why?)

Page 5: DNS – HTTP – DHTML - CSS ICW Lecture 5 Hasan Qunoo

DNS- How does it work?

When a request comes in:• DNS can answer the request with an IP address because

it already knows the IP address for the domain.

• DNS can contact another name server and try to find the IP address for the name requested. It may have to do this multiple times.

• DNS can say, "I don't know the IP address for the domain you requested, but here's the IP address for a name server that knows more than I do."

• DNS can return an error message because the requested domain name is invalid or does not exist.

Page 8: DNS – HTTP – DHTML - CSS ICW Lecture 5 Hasan Qunoo

HTTP- Hypertext Transfer Protocol

• HTTP is an application-level protocol 

• HTTP is used to transfer data on the Web.

• HTTP led to the establishment of the World Wide Web in 1990 by English physicist Tim Berners-Lee.

Page 9: DNS – HTTP – DHTML - CSS ICW Lecture 5 Hasan Qunoo

How does HTTP work?

Page 10: DNS – HTTP – DHTML - CSS ICW Lecture 5 Hasan Qunoo

Request methods

• GET• Requests a file from the server. 

• POST• Submits data to be processed (e.g., from

an HTML form) to the identified resource.

• HEAD• Same as GET without the body.

Page 11: DNS – HTTP – DHTML - CSS ICW Lecture 5 Hasan Qunoo

Request methods (Cont.)

• TRACE

• DELETE

• PUT

• OPTIONS

• CONNECT

Page 12: DNS – HTTP – DHTML - CSS ICW Lecture 5 Hasan Qunoo

Tools

• wget

Page 13: DNS – HTTP – DHTML - CSS ICW Lecture 5 Hasan Qunoo

HTML - Hyper Text Markup Language

How can you help the Editor edit the newspaper?

Page 14: DNS – HTTP – DHTML - CSS ICW Lecture 5 Hasan Qunoo

HTML

- Practical Example:- Start an editor.- Simple HTML (Header, Body).- Start adding components (Image,

Headings, Form)- Design a form response page.

Page 15: DNS – HTTP – DHTML - CSS ICW Lecture 5 Hasan Qunoo

XHTML/HTML• XHTML is a stricter and cleaner version of HTML:

• XHTML Elements Must Be Properly Nested.

<b><i>This text is bold and italic</i></b>

• XHTML Elements Must Always Be Closed.

<p>This is a paragraph</p><p>This is another paragraph</p>

• Empty Elements Must Also Be ClosedA break: <br />

• XHTML Elements Must Be In Lower Case:<body><p>This is a paragraph</p></body>

• XHTML Documents Must Have One Root ElementAll XHTML elements must be nested within the <html> root element. 

The List Goes On...

Page 16: DNS – HTTP – DHTML - CSS ICW Lecture 5 Hasan Qunoo

CSS

• HTML was never intended to contain tags for formatting a document.

• Imagin you have to edit every HTML page every time you want to change the style. NIGHTMARE!

• Do not worry CSS to the rescue.

Page 17: DNS – HTTP – DHTML - CSS ICW Lecture 5 Hasan Qunoo

CSSThe CSS syntax:

selector {property:value}

Example:p {font-family:"sans serif"}

You can also group selectors:

h1,h2,h3,h4,h5,h6 { color:green}

You can select by Class:

h1.center{text-align:center}

<h1 class="center">

This heading will be center-aligned

</h1>

Comments: /*This is a comment*/

Page 18: DNS – HTTP – DHTML - CSS ICW Lecture 5 Hasan Qunoo

Example

- Practical Example:- Start an editor.- Create a css file.- Add simple modifications to the style.- Modify the HTML file.- Style the HTML form from previous

example.- Display the file on the browser.

Page 19: DNS – HTTP – DHTML - CSS ICW Lecture 5 Hasan Qunoo

Resources• HTML, XHTML and CSS tutorials:

• http://www.w3schools.com

• Web Standards• http://www.w3.org/

• Validations• http://validator.w3.org/

• Free CSS Templates:• http://www.csszengarden.com/

Page 20: DNS – HTTP – DHTML - CSS ICW Lecture 5 Hasan Qunoo

Resources• List of all the css properties:

• http://htmlhelp.com/reference/css/all-properties.html

• Domain Name Service DNS • Computer Networks, Fourth Edition By

Andrew S. Tanenbaum Chapter 7

• HTTP Protocol RFCs• http://www.w3.org/Protocols/

• Free CSS Templates:• http://www.csszengarden.com/

Page 21: DNS – HTTP – DHTML - CSS ICW Lecture 5 Hasan Qunoo

Exercise• Using nslookup, host and dig

Commands, find the IP addresses for the following URLs:• www.bham.ac.uk• www.google.co.uk• www.cs.bham.ac.uk• www.w3school.com

• The first 5 students to send me the correct commands and their output will get a prize each.

Page 22: DNS – HTTP – DHTML - CSS ICW Lecture 5 Hasan Qunoo

Conclusion• There are many types of technologies which

are used to support the world wide web and more are being developed all the time. 

• There are many resources to learn more about each of these Technologies.

• Designing web pages is fun.