Chapter 4 The world wide web.

Slides:



Advertisements
Similar presentations
Introduction to Web Design Lecture number:. Todays Aim: Introduction to Web-designing and how its done. Modelling websites in HTML.
Advertisements

Farhan Nisar University of Peshawar
The world wide web Chapter 4. Learning outcomes Explain in general terms how web documents are transferred across the Internet and What processes are.
HyperText Markup Language-
4. Internet Programming ENG224 INFORMATION TECHNOLOGY – Part I
Computers: Tools for an Information Age Writing Your Own Web Page: Using HTML and Web Authoring Tools.
Session 2 Introduction to HyperText Markup Language 4 (HTML 4) Matakuliah: M0114/Web Based Programming Tahun: 2005 Versi: 5.
Tables Tables provide a means of organising the layout of data
HTML popo.
HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.
Web Development & Design Foundations with XHTML
CREATED BY : VIRAL M.KORADIYA. Anchor elements are defined by the element. The element accepts several attributes, but either the Name or HREF attribute.
Internet Services and Web Authoring (CSET 226) Lecture # 5 HyperText Markup Language (HTML) 1.
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
C HAPTER – 3 I NTRODUCTION TO H TML By :- Pinkesh H. Patel.
Chapter 2 HTML Basics Key Concepts
INTRODUCTION TO HYPERTEXT MARKUP LANGUAGE 1. Outline  Introduction  Markup Languages  Editing HTML  Common Tags  Headers  Text Styling  Linking.
A really fairly simple guide to: mobile browser-based application development (part 1) Chris Greenhalgh G54UBI / Chris Greenhalgh
1 Web Developer & Design Foundations with XHTML Chapter 9 Key Concepts.
1 Lecture #5 Static Web Documents Shimrit Tzur-David HAIT Summer 2005.
MR.Mohammed Sharaf al Shareef
CIS101 Introduction to Computing Week 05. Agenda Your questions Exam next week - Excel Introduction to the Internet & HTML Online HTML Resources Using.
CIS101 Introduction to Computing Week 05. Agenda Your questions CIS101 Survey Introduction to the Internet & HTML Online HTML Resources Using the HTML.
Computing Concepts Advanced HTML: Tables and Forms.
World Wide Web1 Applications World Wide Web. 2 Introduction What is hypertext model? Use of hypertext in World Wide Web (WWW) – HTML. WWW client-server.
1 The World Wide Web. 2  Web Fundamentals  Pages are defined by the Hypertext Markup Language (HTML) and contain text, graphics, audio, video and software.
Chapter 2 Introduction to HTML5 Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Chapter 14 Introduction to HTML
CpSc 462/662: Database Management Systems (DBMS) (TEXNH Approach) HTML Basics James Wang.
Presenting Information on WWW using HTML. Presenting Information on the Web with HTML How Web sites are organized and implemented A brief introduction.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
DAT602 Database Application Development Lecture 14 HTML.
Chapter 16 The World Wide Web. 2 The Web An infrastructure of information combined and the network software used to access it Web page A document that.
HTML HTML stands for "Hyper Text Mark-up Language“. Technically, HTML is not a programming language, but rather a markup language. Used to create web pages.
HTML (HyperText Markup Language)
XHTML Introductory1 Linking and Publishing Basic Web Pages Chapter 3.
225 City Avenue, Suite 106 Bala Cynwyd, PA , phone , fax presents… HTML Lists, Tables and Forms v2.0.
Dr. Nuha El-KhaliliInternet Programming ( ) HTML Hyper Text Markup Language The language of web pages Maintained by the W3C
Understanding HTML Code
Chapter 2 HTML Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
1 Web Developer Foundations: Using XHTML Chapter 2 Key Concepts.
1 CSC 121 Computers and Scientific Thinking David Reed Creighton University HTML and Web Pages.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
Chapter 2 XHTML: Part II The Web Warrior Guide to Web Design Technologies.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
HTML: Hyptertext Markup Language Doman’s Sections.
ITCS373: Internet Technology Lecture 5: More HTML.
Introduction HTML (Hypertext Markup Language) is used to create document on the World Wide Web. HTML is not a programming language, it is a markup language.
Copyright © Osmosys O S M O S Y SO S M O S Y S D e p l o y i n g E x p e r i e n c e & E x p e r t i s e™ HTML Training.
Introduction to HTML Xiangming Mu 9/23/ Learning Objectives Understand basic HTML tags and their attributes Learn to create a simple HTML page.
Web Development & Design Foundations with XHTML Chapter 2 HTML/XHTML Basics.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Basic Document Structure.
Introduction to HTML. _______________________________________________________________________________________________________________ 2 Outline Key issues.
Microsoft Expression Web 3 – Illustrated Unit D: Structuring and Styling Text.
WEEK -1 ACM 262 ACM 262 Course Notes. HTML What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML.
HTML HYPER TEXT MARKUP LANGUAGE. INTRODUCTION Normal text” surrounded by bracketed tags that tell browsers how to display web pages Pages end with “.htm”
XP Review 1 New Perspectives on JavaScript, Comprehensive1 Introducing HTML and XHTML Creating Web Pages with HTML.
What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is not a programming language, it is a markup.
Writing Your Own Web Page: Using HTML and FrontPage Chapter 10.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
CHAPTER TWO HTML TAGS. 1.Basic HTML Tags 1.1 HTML: Hypertext Markup Language  HTML stands for Hypertext Markup Language.  It is the markup language.
1 HTML: HyperText Markup Language Representation and Management of Data on the Internet.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
1999, COMPUTER SCIENCE, BUU Introduction to HTML Seree Chinodom
HTML for web designing short course. What is an HTML File? HTML stands for Hyper Text Markup Language An HTML file must have an htm or html file extension.
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
The Web Warrior Guide to Web Design Technologies
Introduction to XHTML.
1 Introduction to XHTML.
Presentation transcript:

Chapter 4 The world wide web

Learning outcomes Explain in general terms how web documents are transferred across the Internet and What processes are triggered when you click on hyperlink Code web pages using HTML and XHTML using style sheets. Explain why it is advisable to use XHTML rather than HTML Describe some technologies available for dynamic web pages

Essential Reading Joe Casad, Teach yourself TCP/IP, Ch. 17 William Buchanan, Mastering The Internet, Ch. 6-8 Introductory materials on HTML & XHTML either a text book such as John Shelly, HTML AND CSS explained, or http:/www.webMonkey.com http://www.w3schools.com

Additional reading William Buchanan, Mastering The Internet, Ch. 9-10 Andrew Tanenbaum, Computer Networks, Ch. 7.3 Douglas Comer, Computer Netwoks and Networking, ch. 32-33 Chuck Masciano and Bill Kennedy, HTML and XHTML the definitive guide, for reference http://www.pcnetworkadvisor.com Mike Lewis, “Understanding Javascript”, June-Jully 2000

How the web works The client-server model Client and server operate on machines which are able to communicate through a network The server waits for requests from a clients Server receives a requests from a client Performs a the requested work Or lookup the requested data And send a response to the client Servers: file servers, web servers, name servers Clients: browsers, email clients

url format http://doc.gold.ac.uk/~username/index.html <scheme>://<server-domain-name>/<pathmane> <scheme> which protocol to use http: in general file: which tells the client document is in a local machine ftp: file transfer protocol <server-domain-name> identifies the server system i.e. www.doc.gold.ac.uk <pathname> tells the server where to find the file http://doc.gold.ac.uk/~username/index.html

Web browsers and servers A browser: is a program that can retrieve files from the world wide web and render text, images, or sounds encoded in the files. i.e. IE, Nescape, Mozilla A web server: is an application which waits for client requests, fetches requested documents from disk and transmits them the client. i.e Apache

What happened when you click on hyperlink? Determine URL and extract domaine name. Use the name server to get IP address (DNS) Make a TCP connect to port 80 And send a request for a web page once the server has accepted to connection. The server send the file and releases the TCP connection The client displays the document.

Other possibilities The steps in the previous slide are for displaying a static web page from a remote machine. Other possibilities are: Page is loaded from a local system no tcp connection url begin with file://... The page is dynamically generated by a client-side script No tcp connection The page is dynamically generated by a server-side script: The server may carry out other functions Secure server Check user’s identity if they are authorised to access a particular resources

Stateless connection Both client and server release TCP connection after a page has been transferred. HTTP1.0 is stateless Connections are not persistent There is no indication to the server whether new transactions involve the same client HTTP 1.1 is persistent By keeping track of the client IP addresses However, there is no way of identifying a repeated visits to the site by the same user. Futhermore, ISPs reallocate IP addresses to dial-up customers as new user dial in.

Cookies Request the browser to store a small data file (cookie) on the users hard disk. Which can serve to identify users only. For instance it could contain a key into a database on the server machine. Most browsers nowadays allow you to decide whether or not you want cookies on your machine.

Introduction to HTML

What is an HTML File? HTML stands for HyperText Markup Language An HTML file is a text file containing small markup tags The markup tags tell the Web browser how to display the page An HTML file must have an htm or html file extension An HTML file can be created using a simple text editor

Internet - Services Email & MIME (Multipurpose Internet Mail Extensions) text (text/html), image, video, etc. Telnet & ssh FTP – File Transfer Protocol Gopher IRC – Internet Relay Chat Newsgroups WWW – World Wide Web HTTP (Hypertext transfer protocol) uses a Question-Answer-Scheme, i.e. a browser sends a request und gets a response from a server. Note the server does not send out anything without a request.

Markup languages Suppose we have a document containing only plain text We tag certain parts of the document to indicate what they are and how they should be formatted This procedure is called marking-up the document Tags are usually paired: e.g. <title>My Memoirs</title> A pair of tags plus their content constitute an element Un-paired tags are called empty tags

Markup languages Physical vs Semantic markup physical refers to appearance (style) on the page semantic refers to structure and meaning HTML is the HyperText Markup Language HTML is based on SGML (Standard Generalised Markup Language) which is more complex HTML has a fixed set of tags but is constantly evolving, but newer versions are downward compatible

Markup languages HTML places primary emphasis on structure paragraphs, headings, lists, images, links, …. HTML places secondary emphasis on style (CSS)‏ fonts, colours, …. HTML does not label the meaning of the text (XML)‏

<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”> A basic document Every document should start with the following line <!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”> There are three required elements, defined by the tags <html>, <head> and <body> <html> <head> <title>My Home Page</title> </head> <body> <h1>Welcome</h1> </body> </html>

Basic structure elements first and last tags The HEAD section must come before the BODY section contains generic information about the document Elements specified in the HEAD section can include title, link, script, style The BODY section contains the content of the document (text, images etc) this content is structured by other tags

Block elements Block elements define sections of text, usually preceded by a blank line <p></p> - paragraph <h1></h1>...<h6></h6> - headings <pre></pre> - preserve (original format)‏ <blockquote></blockquote> - indented text <div></div> - division used to identify a section of the document that may be subject to special formatting (for example, using stylesheets).

Paragraphs Paragraphs: <p>...</p> force a break between the enclosed text and the text surrounding it the tagged region of text may be subject to special formatting <p align="center">Here is another paragraph</p> align is an attribute of the paragraph tag center is the value of the align attribute <p>here is a piece of text that has been placed inside a paragraph</p> <p align="center">Here is another paragraph</p>

Headings Six levels of importance <h1>...<h6> Use headings to divide document into sections <html> <head> <title>Headings</title> </head> <body> <h2>Chapter 1</h2> <h3>1. Introduction</h3> This is the introduction <h3>2. Next section</h3> This is the next section <h4>2.1 A subsection</h4> This is a subsection </body> </html>

Element relationships The elements marked by tags form a hierarchy The root element is html (marked by <html>...</html>)‏ It usually has two children: head and body each of these are further subdivided There are rules for which elements can contain other elements e.g. headers cannot contain headers see http://www.w3.org/ for a full list of rules Elements must not overlap each other we cannot have: <h1>...<a..> ... </h1>...</a> we can have: <h1>...<a..> ... </a>...</h1>

Inline descriptive elements Descriptive elements affect the appearance of text depending on how the text is described <em></em> emphasis, usually with italics <strong></strong> strong, usually with bold <cite></cite> citation, usually in italics <code></code> usually results in monotype spacing <body> A <em>fascinating</em> subject that I <strong>must</strong> understand </body>

Inline explicit style elements <boldface></boldface> <big></big> bigger font than surrounding text <small></small> smaller font than surrounding text <i></i> italics <s></s> strikethrough <sub></sub> subscripts <sup></sup> superscripts <span></span> delimits text for stylesheet control <div></div> delimits blocks of text for stylesheet control

Inline explicit style elements <font> attributes face - name of font (must be installed)‏ "arial", "times", "verdana", "helvetica" size - absolute size (1-7), or relative to previous text "2", "5", "7", "+1", "-2"... color - hexadecimal RGB, or a named color "3399dd", "blue", "red" weight - boldness from 100, 200, ..., 900 "100", "300", "900" e.g. <font face="arial" size="+1" color="pink" weight="300">

Ordered and Unordered Lists some normal text <ol> <li>apples</li> <li>oranges</li> <li>pears</li> <li>bananas</li> </ol> some normal text <ul> <li>apples</li> <li>oranges</li> <li>pears</li> <li>bananas</li> </ul>

<!– this is a comment --> Comments Comments are delimited by <!-- and --> <!– this is a comment --> Comments may span multiple lines <body> <!-- this is a comment --> </body>

Special characters <body> A <em> < fascinating > </em> subject that I <strong>m u s t</strong> understand </body> Some characters such as <, >, " and & have special meanings. To prevent them being interpreted as HTML code, they must be written as follows: < > " & Blank space is normally ignored in HTML. To include a space in your document use:  

<img src="mypicture.gif" alt="my picture"> Links and Images Link: <body> The Department of <a href="http://www.doc.gold.ac.uk/index.html"> Computing </a> is a very .... </body> images: <img src="mypicture.gif" alt="my picture"> src attribute specifies the file containing the image alt attribute specifies the text to be displayed if the image is not viewed

<body bgcolor="#994422"> <body background="tileimage.gif"> Colour – RGB Model #ff0000 (red), #00ff00 (green)‏ #0000ff (blue)‏ #ffff00 (yellow)‏ ... #3395ab (a pastel blue)‏ <body bgcolor="#994422"> <body text="#994422"> <body background="tileimage.gif">

Forms Server-based programs may return data to the client as a web page Client-side scripts can read input data To validate the data, prior to sending to server To use in local processing which may output web page content that is displayed on the client

Example applications Questionnaires to provide feedback on a web site e-commerce, to enter name, address, details of purchase and credit-card number request brochures from a company make a booking for holiday, cinema etc. buy a book, cd, etc obtain a map giving directions to a shop Run a database query and receive results (an important part of e-commerce)‏

Forms text checkbox radio (buttons)‏ select (options)‏ textarea Input types text checkbox radio (buttons)‏ select (options)‏ textarea password button submit reset hidden file image

The method and action attributes The method attribute specifies the way that form data is sent to the server program GET appends the data to the URL POST sends the data separately The action attribute specifies a server program that processes the form data (often as a URL)‏ <body> <form method="POST" action="comments.php"> <h2>Tell us what you think</h2> <!-- etc --> </form> </body>

Text, checkbox and Radio button The type attribute specifies the type of user input The name attribute gives an identifier to the input data <form method="POST" action="comments.php"> <h2>Tell us what you think</h2> Name <input name="name" type="text“ size="20"><br> Address <input name="address" type="text" size="30"> </form> How did you hear about this web site?<br> A friend <input type="checkbox" name=“name" value="friend"><br> Search engine <input type="checkbox" name=“name" value="engine"><br> How did you hear about this web site?<br> A friend <input type="radio" name=“name" value="friend"><br> Search engine <input type="radio" name=“name" value="engine"><br> <!– etc -->

The input element: type="submit/reset“ and select element Thank you<br> <input type="submit" name="send" value="Send"> <input type="reset" name="clear" value="Clear"><br> How do you rate this site?<br> <select name="rating"> <option>Good <option selected>Bad <option>Ugly </select>

Tables <table border="1"> <tr> <th>Name</th> <td>A B Morgan</td> <td>D P Jones</td> </tr> <th>Course</th> <td>Fishing</td> <td>Sailing</td> <th>Year</th> <td>8</td> <td>5</td> </table> <table> main element <tr> table row <th> table header <td> table data

The align and width attributes The align attribute determines the position of the text within a cell The width attribute determines the width of the row relative to the table <table border="1" align="center"> <tr> <th colspan="2" width="60%">Name</th> <th rowspan="2">Course</th> <th rowspan="2">Year</th> </tr> <th>Last</th> <th>Init.</th> <td>Morgan</td> <td>AB</td> <td>Fishing</td> <td align="center">5</td> <!– etc -->

Table attributes Table attributes Furthermore align alignment relative to the page width in pixels or percentage of page width border - width of border (pixels)‏ cellspacing separation between cells (pixels)‏ cellpadding - space around data inside cell (pixels)‏ bgcolor - background colour (inside cells)‏ Furthermore The <caption> element puts a title above the table

Table attributes <table border="3" align="center" cellspacing="6" cellpadding="6" bgcolor="cyan"> <caption> <h2>Course Data</h2> </caption> <tr> <th>Name</th> <th>Course</th> <th>Year</th> </tr> <td>A B Morgan</td> <td>Fishing</td> <td>5</td> <!– etc -->

Frames and Framesets A frameset partitions a web browser window so that multiple web documents can be displayed simultaneously. Example application: To maintain a permanently visible directory of links within your site, while also displaying one or more selected documents from the site.

Framesets <html> <head><title>Frames 1</title></head> <frameset cols="140,*"> <frame name="navF" src="navigation.html"> <frame name="mainF" src="intro.html"> </frameset> </html> The frameset element replaces the body element frameset has attributes cols or rows, defined in terms of pixels, percentage(%) or unspecified (*) this splits the window into two or more columns or rows

Noframes Some browsers cannot process frames. Alternative content should be provided using the noframes element <html> <head><title>Frames 1</title></head> <frameset cols="140,*"> <frame name="navF" src="navigation.html"> <frame name="mainF" src="intro.html"> </frameset> <noframes> <body> Something here for browsers not supporting frames </body> </noframes> </html>

<link rel="StyleSheet" type="text/css" href="URL"> Styles can be defined Inline styles Global styles Stylesheets (Cascading stylesheets) <h1 style="color:#2255ff; border:ridge">Inline styles</h1> <head> <title>Styles</title> <style> <!-- h1 { color: red; border: thin; groove; text-align:center; } --> </style> </head> <link rel="StyleSheet" type="text/css" href="URL">

Classes Simple style rules change the appearance of all instances of the associated element A class is a style definition that may be applied as and when we choose if we don't want the styles, we don't have to use them Simple classes are applied to a single type of element Anonymous classes can be applied to any type of element

Simple classes </head> <style> <!-- h1.fred { color: #eeebd2; background-color: #d8a29b; border: thin groove #9baab2; } --> </style> <body> <h1 class="fred">A Simple Heading</h1> <p>some text . . . some text</p> </body>

Anonymous classes </head> <style> <!-- .fred { color: #eeebd2; background-color: #d8a29b; border: thin groove #9baab2; } --> </style> <body> <h1 class="fred">A Simple Heading</h1> <p class="fred">some text . . . some text</p> </body>

Divisions and spans Rather than applying styles to an element itself, we wrap the element in a div element (usually for block elements), or a span element (usually for inline elements)‏ Any required formatting can then be applied to the <div> or <span> element. Div and span elements become part of the document In particular, each can have class and id attributes

Divisions Styles can be applied to blocks of HTML code using div <head> <style> <!-- .myclass { color: blue; background: cyan; text-decoration: underline; border: thin groove red; } --> </style> </head> <body> <div class="myclass"> <h2>A Simple Heading</h2> <p>some text . . . </p> </div> </body> Styles can be applied to blocks of HTML code using div

Spans spans are similar to divisions <head> <style> <!-- .myclass { color: red; background: cyan; text-decoration: none; } --> </style> </head> <body> <span class="myclass"> <h2>A Simple Heading</h2> <p>some text . . . </p> </span> </body>

Summary By now you should be able to use: Tables Frames Stylesheet – CSS Inline style Embedded style External style

Typical exam question explain why is it important to separate the content from the style. what is CSS? State three ways in which styles can be used. And explain the advantages and disadvantages of each one.

Next Look at the disadvantages of html XML XHTML vs HTML DHTML Well formed vs valid xml document XHTML vs HTML DHTML

Useful sites http://www.w3schools.com/ http://www.w3schools.com/html http://www.w3schools.com/css