CP3024 Lecture 5 State Maintenance, Cascading Style Sheets and Dynamic HTML.

Slides:



Advertisements
Similar presentations
1 © Netskills Quality Internet Training, University of Newcastle Introducing Cascading Style Sheets © Netskills, Quality Internet.
Advertisements

Cascading Style Sheets (CSS) “Styles” for short. Pg. 418.
Today CSS HTML A project.
It’s All About Style The Basics of Style Sheets Presented by Barry Diehl.
Introduction to Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 4.
Cascading Style Sheets SP.772 May 6, CSS Useful for creating one unified look for an entire web site. Helps to seperate style from content. Can.
Cascading Style Sheets. Slide 2 Lecture Overview Overview of Cascading Style Sheets (CSS) Ways to declare a CSS CSS formatting capabilities New features.
Multimedia and the World Wide Web HCI 201 Lecture Notes #7A.
Cascading Style Sheets Scripting with Style. CSS versus HTML  Ways to format in HTML –HTML Tag extensions –Converting Text to images –Page Layout with.
Cascading Style Sheets. What is a style sheet? >A controlling document (or part of the document) >Sets the default appearance of items on the web page.
Cascading Style Sheets1. 2 n Style sheets are a means of controlling the way HTML tags are formatted n IE introduced style sheets in IE 3.0 release n.
4.01 Cascading Style Sheets
CM143 Week 4 Introducing CSS. Cascading Style Sheets A definition for the style in which an element of the webpage will be displayed Border width, colour,
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.
Lecture 7 Cascading Style Sheets (CSS) Boriana Koleva Room: C54
 Missing (or duplicate) semicolons can make the browser completely ignore the style rule.  You may add extra spaces between the properties/values to.
1 Working with Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size,
1 Web Developer Foundations: Using XHTML Chapter 9 Cascading Style Sheet Concepts.
Cascading Style Sheets (CSS) Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
Headings, Paragraphs, Formatting, Links, Head, CSS, Images
Cascading Style Sheets (CSS) 1.  What is CSS?  Why CSS?  How to write a CSS? 2.
Week 4.  Three ways to apply CSS: Inline CSS Internal style sheets ( header style information) External style sheets.
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
Cascading Style Sheet (CSS)
Today’s objectives  Complete web page  Using xhtml & CSS  Adding CSS to documents Embed url(File);  CSS.
CSS Introduction Cascading Style Sheets Provides a great deal of control over the presentation of the document HTML indicates both semantics of a document.
Cascading Style Sheets. Defines the presentation of one or more web pages Similar to a template Can control the appearance of an entire web site giving.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
Introduction to CSS CSS Syntax - Fort Collins, CO Copyright © XTR Systems, LLC Cascading Style Sheets - Syntax & Semantics Instructor: Joseph DiVerdi,
Cascading Style Sheets Class 1, Lecture 1 Rachel A Ober
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
Using Cascading Style Sheet As you create more web pages, you may wish to impose a consistent look for all of your web pages or for group of related pages.
CO1552 – Web Application Development Cascading Style Sheets.
CSS Basic (cascading style sheets)
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 7.
IS1825: Developing Multimedia Applications for Business Lecture 1: Introduction to CSS Rob Gleasure
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
Chapter 6 Server-side Programming: Java Servlets
 Use the think diagram … ISP Server.
Sessions in PHP – Page 1 of 13CSCI 2910 – Client/Server-Side Programming CSCI 2910 Client/Server-Side Programming Topic: Sessions in PHP Reading: Williams.
Web Development 101 Presented by John Valance
DHTML. What is it? Dynamic HTML. Not a standard unlike HTML or Java It is a term applied by both Netscape and Microsoft to a collection of technologies.
HTML GUIDE Press F5 and then Click on the links on the left to get to the section you want Section 1: Getting Started Section 2: Moving Banner Section.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
1 Working with Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size,
CSS Cascading Style Sheets A very brief introduction CSS, Cascading Style Sheets1.
SESSIONS 27/2/12 Lecture 8. ? Operator Similar to the if statement but returns a value derived from one of two expressions by a colon. Syntax: (expression)
CSS Hadas Kahsay. Overview  What is CSS  Basic syntax of CSS Rules  How to link CSS style to html documents  Browsers and CSS  Advantages of CSS.
How to… Cascading Style Sheets. How to Insert a Style Sheet When a browser reads a style sheet, it will format the document according to it. There are.
CSS FOUNDATIONS IN-DEPTH The nitty-gritty of css...
NASRULLAHIBA.  It is time to take your web designing skills to the next level with Cascading Style Sheets (CSS). They are a way to control the look and.
HTML5 and CSS3 Illustrated Unit C: Getting Started with CSS.
HTTP Transactions 1. 2 Client-Server Model 3 HTTP HyperText Transport Protocol Native protocol for WWW Sits on top of internet’s TCP/IP protocol HTTP.
What is CSS? A set of style rules that tell the web browser how to present a web page or document. – In earlier versions of HTML, style characteristics,
1 Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size, font color etc…
CASCADING STYLE SHEET CSS. CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to solve a problem.
Cascading Style Sheets Using HTML. What are they? A set of style rules that tell the web browser how to present a web page or document. In earlier versions.
Cascading Style Sheets
IS 360 Declaring CSS Styles
Open Source Programming
Cascading Style Sheets
Website Design 3
Cascading Style Sheets - Building a stylesheet
Introduction to Cascading Style Sheets (CSS)
Cascading Style Sheets
SESSION TRACKING BY DINESH KUMAR.R.
Cascading Style Sheets - Building a stylesheet
Introduction to Styling
Presentation transcript:

CP3024 Lecture 5 State Maintenance, Cascading Style Sheets and Dynamic HTML

Typical Web-based Purchase  Number of steps –View X –Add X to shopping cart –ViewY –Add Y to shopping cart –Purchase goods  Relies on server remembering prior purchases

Recording State  HTTP is stateless  Need mechanism to impose state on top of HTTP  Session recording –Cookies –URL rewriting

Sessions  Sessions are a group of interactions between a client and the server  Typically begun via an initial request  May terminate due to server action, client action or timeout (client inaction)  Every session will have a unique id

State Maintenance  For each session the server application will maintain state information  Each request from client will be accompanied by session id  Applications can retrieve the state of transaction for that session  Session id indicated via cookie or URL

Cookies  Introduced by Netscape  Small files sent by server and stored by the client (<4KB)  On revisiting a page or site the client presents the cookie to the server  Maybe short term or long lasting  Sometimes considered insecure  Can be seen as an invasion of privacy

URL Rewriting  Can be used where cookies have been forbidden  Session id is appended to URLs in the page returned to the browser  E.g. becomes

Session Handling in PHP  Session handling was added in version 4 of PHP  Previously implemented in an external library PHPLIB  Library routines allow variables to be associated with a session number  See local doc:

PHP Session Handling Routines  session_start  session_destroy  session_name  session_module_name  session_save_path  session_id  session_register  session_unregister  session_unset  session_is_registered  session_get_cookie_params  session_set_cookie_params  session_decode  session_encode

Simple Session Example SessionTest <? session_register("scount"); $scount++; $pcount++; ?> Page count: Session count:

Screenshot of Example

URL Rewriting in PHP  Can be done automatically with appropriate server set up  Otherwise must append session number to every URL using SID constant

URL Rewrite Example <?php session_register("count"); $count++; ?> Hello visitor, you have seen this page times. To continue, "> click here

Cascading Style Sheets  HTML meant to define content not style  Browser has control over presentation  Later additions have emphasised presentation issues  1996 W3C created CSS to deal with presentation external to HTML  Browser support is growing

What Is a Style?  Styles tell the browser how to render a item tagged in HTML  If browser cannot support style result should still be legible  Three types –Inline styles –Document level styles –External style sheets

Why Cascading?  Document presentation may be affected with reference to more than set of rules  Inline styles override document-level styles  Document-level styles override external style sheet styles  All styles override browser defaults

Inline Styles  Style attached to a specific tag on the HTML page  E.g. Red Bold Text

Document-level Styles  Styles defined within the head of an HTML page  Defined using the tag  Effect is to define a style to be applied to all the tags of a given type in a document

Document-Level Example Style Example <!-- H1 {color: red; font-style: bold} -->

External Style Sheets  Styles contained in an external file referenced by HTML page  Style file must have MIME type text/css  Normally called ??????.css  Referenced by a tag in the page’s head section  Pages may refer to more than one style sheet

Typical Style Sheet File BODY { background:#ccffff; color:#000099; font-family:"Bookman Old Style"; margin: 2em 2em 4em 4em; } A:link { color:#ff0000; }

Using a Stylesheet Wolverhampton Methodist Churches

Stylesheets in Action

Style Syntax  The general syntax for a style rule is: tag-selector {property1:value1; property2:value2; ……..} body {color:blue; margin-left: 0.5cm;}

Multiple Selectors  The same style can be applied to a number of tags  E.g. h1, h2, h3, h4, h5, {text-align: center}

Contextual Selectors  Styles applied to nested tags  E.g. ol ol ol li {list-style: lower-alpha} h1 em {color: blue} h1 em, p strong, address {color: blue}

Style classes  Allows the creation of several styles for the same tag distinguished by a name  Name of style to be used is given in tag  Can also define generic styles which are independent of specific tags  Pseudo classes define styles for tag states

Class Example  Style for an abstract of a project report p.abstract { font-style: italic; margin-left: 0.5cm; margin-right: 0.5cm; } text

Generic class  Not associated with a given tag.italic {font-style: italic} Italic text para1 para2

Pseudo Classes (CSS1)  3 apply to the tag: link, active, visited  2 apply to any text tag: first-line and first- letter a:link{color:red} a:active{color:green; font-weight:bold} a:visited{color:darkblue} p:first-line{font-size: 200%}

Current State of CSS  1996 CSS1  1998 CSS2  Now CSS3 in development!  Not fully supported by any browser

Applets  Code which downloads and executes within a browser –ActiveX –Flash –Java Applets –Shockwave

What is Dynamic HTML?  A term which encompasses: –JavaScript/JScript –Applets –CSS –Server side scripting –ActiveX –Client Pull –Server Push

Summary  Session Control  Cascading Style Sheets (CSS)  Dynamic HTML