CS144 Notes: Web Standards

Similar documents
CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0

HTML CS 4640 Programming Languages for Web Applications

HTML. HTML Evolution

Introduction to Web Technologies

Document Object Model. Overview

Introduction to WEB PROGRAMMING

CSI 3140 WWW Structures, Techniques and Standards. Markup Languages: XHTML 1.0

HTML & CSS. SWE 432, Fall 2017 Design and Implementation of Software for the Web

HTML Summary. All of the following are containers. Structure. Italics Bold. Line Break. Horizontal Rule. Non-break (hard) space.

Certified HTML5 Developer VS-1029

COPYRIGHTED MATERIAL. Contents. Chapter 1: Creating Structured Documents 1

CSCI-1680 WWW Rodrigo Fonseca

CS134 Web Site Design & Development. Quiz1

Scripting for Multimedia LECTURE 5: INTRODUCING CSS3

HTTP and HTML. We will use HTML as a frontend to our webapplications, therefore a basic knowledge of HTML is required, especially in forms.

XHTML & CSS CASCADING STYLE SHEETS

Chapter 1 Getting Started with HTML 5 1. Chapter 2 Introduction to New Elements in HTML 5 21

Markup Language. Made up of elements Elements create a document tree

Introduction to HTML5

The HTTP protocol. Fulvio Corno, Dario Bonino. 08/10/09 http 1

CS WEB TECHNOLOGY

CSCI-1680 WWW Rodrigo Fonseca

Basic Web Pages with XHTML (and a bit of CSS) CSE 190 M (Web Programming), Spring 2008 University of Washington Reading: Chapter 1, sections

introduction to XHTML

HTML HTML/XHTML HTML / XHTML HTML HTML: XHTML: (extensible HTML) Loose syntax Few syntactic rules: not enforced by HTML processors.

Application Layer: The Web and HTTP Sec 2.2 Prof Lina Battestilli Fall 2017

WEB TECHNOLOGIES CHAPTER 1

Html basics Course Outline

COPYRIGHTED MATERIAL. The Basics of HTML. What Is the World Wide Web?

Web Development IB PRECISION EXAMS

Study Guide 2 - HTML and CSS - Chap. 6,8,10,11,12 Name - Alexia Bernardo

Introduction to using HTML to design webpages

Ministry of Higher Education and Scientific Research

Chapter 2:- Introduction to XHTML. Compiled By:- Sanjay Patel Assistant Professor, SVBIT.

Lab Introduction to Cascading Style Sheets

Web development using PHP & MySQL with HTML5, CSS, JavaScript

Comp-206 : Introduction to Software Systems Lecture 23. Alexandre Denault Computer Science McGill University Fall 2006

Tutorial 1 Getting Started with HTML5. HTML, CSS, and Dynamic HTML 5 TH EDITION

CS 43: Computer Networks. Layering & HTTP September 7, 2018

MODULE 2 HTML 5 FUNDAMENTALS. HyperText. > Douglas Engelbart ( )

CSS: The Basics CISC 282 September 20, 2014

CSS: Cascading Style Sheets

Wireframe :: tistory wireframe tistory.

Web Publishing Basics I

Module 2 (III): XHTML

Web Design and Development ACS Chapter 3. Document Setup

CompuScholar, Inc. Alignment to Utah's Web Development I Standards

Web Programming Pre-01A Web Programming Technologies. Aryo Pinandito, ST, M.MT

Lecture : 3. Practical : 2. Course Credit. Tutorial : 0. Total : 5. Course Learning Outcomes

What is a web site? Web editors Introduction to HTML (Hyper Text Markup Language)

Digital Asset Management 2. Introduction to Digital Media Format

Applications & Application-Layer Protocols: The Web & HTTP

Programmazione Web a.a. 2017/2018 HTML5

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6

Lab 4 CSS CISC1600, Spring 2012

Text and Layout. Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 11. This presentation 2004, MacAvon Media Productions

Networking and Internet

HTML. Hypertext Markup Language. Code used to create web pages

ECE697AA Lecture 2. Today s lecture

COPYRIGHTED MATERIAL. Contents. Introduction. Chapter 1: Structuring Documents for the Web 1

Networking. INFO/CSE 100, Spring 2006 Fluency in Information Technology.

Scripting for Multimedia LECTURE 1: INTRODUCING HTML5

Introduc)on to Computer Networks

HTML. Mohammed Alhessi M.Sc. Geomatics Engineering. Internet GIS Technologies كلية اآلداب - قسم الجغرافيا نظم المعلومات الجغرافية

Varargs Training & Software Development Centre Private Limited, Module: HTML5, CSS3 & JavaScript

GRAPHIC WEB DESIGNER PROGRAM

Chapter 10: Understanding the Standards

Web and Apps 1) HTML - CSS

How the Internet Works

The HTTP Protocol HTTP

CSS for Styling CS380

Web Systems & Technologies: An Introduction

HTML TAG SUMMARY HTML REFERENCE 18 TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES MOST TAGS

HTML & CSS. Lesson 1: HTML Basics Lesson 2: Adding Tables Lesson 3: Intro to CSS Lesson 4: CSS in more detail Lesson 5: Review

Static Webpage Development

Web Systems & Technologies: An Introduction

Web Development and HTML. Shan-Hung Wu CS, NTHU

Fundamentals of Website Development

CMT111-01/M1: HTML & Dreamweaver. Creating an HTML Document

Cascading Style Sheet. Styles as Tag Attributes. Syntax. <h1>: what font type/size is used? STYLE = SELECTOR {RULES} Attributes such as bgcolor

Certified HTML Designer VS-1027

1/6/ :28 AM Approved New Course (First Version) CS 50A Course Outline as of Fall 2014

Web Development & Design Foundations with XHTML. Chapter 2 Key Concepts

Make a Website. A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1

NEW WEBMASTER HTML & CSS FOR BEGINNERS COURSE SYNOPSIS

HTML Overview. With an emphasis on XHTML

XHTML. XHTML stands for EXtensible HyperText Markup Language. XHTML is the next generation of HTML. XHTML is almost identical to HTML 4.

HTTP Protocol and Server-Side Basics

Website Development with HTML5, CSS and Bootstrap

CS193i Handout #18. HTTP Part 5

HTML is a mark-up language, in that it specifies the roles the different parts of the document are to play.

Announcements. 1. Class webpage: Have you been reading the announcements? Lecture slides and coding examples will be posted

Applications & Application-Layer Protocols: The Web & HTTP

Unit 4 The Web. Computer Concepts Unit Contents. 4 Web Overview. 4 Section A: Web Basics. 4 Evolution

Notes beforehand... For more details: See the (online) presentation program.

Summary 4/5. (contains info about the html)

Index. alt, 38, 57 class, 86, 88, 101, 107 href, 24, 51, 57 id, 86 88, 98 overview, 37. src, 37, 57. backend, WordPress, 146, 148

WML2.0 TUTORIAL. The XHTML Basic defined by the W3C is a proper subset of XHTML, which is a reformulation of HTML in XML.

Assignments (4) Assessment as per Schedule (2)

Semantic Web Lecture Part 1. Prof. Do van Thanh

Transcription:

CS144 Notes: Web Standards Basic interaction Example: http://www.youtube.com - Q: what is going on behind the scene? * Q: What entities are involved in this interaction? * Q: What is the role of each entity? Q: What runs on server? client? network? Who keeps track of what is being done? * Q: There are many Web servers on the Internet. How can the Web browser reach and communicate with the YouTube server? * Q: Many things are exchanged over Internet. Email, instant messaging, file transfer, etc. How does the server know that this "client" wants a "Web page"? * Q: Only bytes are transferred. How do they communicate rich, dynamic multimedia content? TCP/IP, http, html - TCP/IP (transmission control protocol and internet protocol) * internet routing and transportation protocol - http (hypertext transportation protocol) * communication protocol between web servers and web clients - html (hypertext markup language) * page formatting and linking standard 1

HTTP HTTP/1.1 most popular (HTTP/2 is the most recent) Request & response client --- request --> <-- response server Stateless: every request is handled independently from others - Q: what are pros/cons of stateless protocol? message = request/status line + header + body - http request * the bare minimum HTTP request -- can be issued through telnet GET / HTTP/1.0 * e.g. GET /cs144/examples/form.html HTTP/1.1 <- request line Host: oak.cs.ucla.edu <- beginning of header User-Agent: Mozilla/5.0... Referrer: http://oak.cs.ucla.edu/cs144/ Accept:text/xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Cookie: utmz=125574670.1174236576.14.14... <-- end of header - request line: the actual request * more on the "GET" method later - header: additional information for the request * Host: the name of the web server Q: why do we need the "Host:" field? Aren t we already contacting it? 2

* User-Agent: information on the client software * Referrer: The page linking to the requested page. Q: how can it be used? Can the server reconstruct the user's click path? * Accept... : what media/content is acceptable to the client q=... specifies how much the type is "preferred" * Keep-Alive, Connection: in case we want to make multiple requests through one connection Q: why do we want to make multiple requests per connection? * Cookie: more on this later - http response * e.g. HTTP/1.1 200 OK <-- status line Date: Wed, 04 Apr 2007 03:20:33 GMT <-- beginning of header Server: Apache Last-Modified: Wed, 04 Apr 2007 03:19:25 GMT ETag: "15b63b-af-ebdb0940" Content-Length: 175 Connection: close Content-Type: text/html <-- end of header <-- header and body separated by empty line with CRLF <html> <-- beginng of body <head><title>example page</title></head>... - Status line: * 2xx: Success - The action was successfully received, understood, and accepted * 3xx: Redirection - Further action must be taken in order to complete the request * 4xx: Client Error - The request contains bad syntax or cannot be fulfilled * 5xx: Server Error - The server failed to fulfill an apparently valid request - ETag: a unique tag that is the same only if the body is the same * Q: when will it be useful? - Content-Length: length of the body 3

- Content-Type: the type of the content html, flash, pdf, etc. favicon (favorite icon. small icon next to the URL) - default: /favicon.ico of the site - can be customized for every page by adding the following to <head> <link rel="shortcut icon" href="..." type="image/vnd.microsoft.icon"> HTTP/2 - HTTP standard approved on Feb 17, 2015 - Backward-compatible extension to HTTP/1.1 * Data compression of HTTP headers * Parallel loading of page elements over a single TCP connection * Server push technologies HTML (HyperText Markup Language) Current version: HTML5-1991: HTML(1) * Designed by Tim-Berner s Lee at CERNS * Based on SGML (Standard Generalized Markup Language) - 1995: HTML2.0, 1997: HTML3.2, 1998: HTML4.01, 2000: XHTML, 2014: HTML5 - HTML 4.01 is most widely used - Standardization is both technical and political process Basic HTML - document = text + tags * Tags are enclosed in < > - HTML tags * Tags are enclosed in < > * Tag names are case insensitive, but lowercase is recommended * Open tag <x> needs a matching closed tag </x> Except empty elements such as <br>, <hr>, <img> <p> is NOT an empty element, but most browsers do not enforce closing it * Tags can have attributes E.g., <img src= > Both single or double quotes can be used to enclose the attribute value * Tags represent the structure of the document not the style or formatting Use CSS (Cascading Style Sheet) for formatting 4

- <font>, <center>, <u>, <s>, <tt> tags are deprecated in HTML5 * Can use attribute style= font-family:courier if necessary * Use <del>, <ins>, <kbd>, <code>,..., instead - <b> and <i> tags still remain. Just too popular * Use <strong> or <em> if that is what we intend Q: Why do they try separate structure from style? - Text * Any text not enclosed in < > Q: How do we include < or > in text? What about &? * Multiple white spaces and line breaks are merged into one white space Q: How do we include multiple white spaces? Line breaks? - Comments appear in <!-- --> - Overall structure <!DOCTYPE html> <html> <head>...</head> <body>...</body> </html> - <!DOCTYPE > * "mostly useless, but required" header to trigger "standards mode" in common browsers in HTML5 * HTML5 <!DOCTYPE html> * HTML 4.01 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/tr/html4/strict.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/tr/html4/loose.dtd"> - Includes deprecated tags for easier transition 5

The URLs point to DTD (Document Type Definition) file that describes allowed HTML tags and their structure. Remnants of SGML heritage * XHTML 1.1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd"> Q: Where do we specify the text displayed in title bar? Including non-text materials - Q: how can we embed a link? * <a href=url>...</a> * note: <link rel=relationship href=url> does not generate a clickable link e.g., <link rel="stylesheet" type="text/css" href="style.css"> - Q: how can we embed a multimedia object? * HTML 4.01 Image: <img src= url > tag Others: <object...> tag - standard: <object data=url type=content-type> <object data="http://www.youtube.com/admp.swf?vids=w- 5sB6WtFe4&eurl=/index&iurl=http%3A//img.youtube.com/vi/W- 5sB6WtFe4/2.jpg&t=OEgsToPDskK05Y3DPYXD_7PQPApoSbvK" type="application/x-shockwave-flash"></object> - <embed src=url type=content-type> in also very common (nonstandard) due to browser compatibility issues * HTML5 Image: <img...> tag Audio: <audio src= voice.mp3 type= audio/mpeg controls> tag - Controls attribute add control buttons like play, pause, volume, etc Video: <video src= video.mp4 type= audio/mp4 controls> tag Others: <object...> tag 6

XHTML - Mostly the same thing, but much more strict formatting rules * tags and attributes MUST be lower case, not upper case. * ALL tags MUST have matching end tags (e.g., <p></p>) * always use quotes around attribute values - Not widely adopted because it is too strict HTML5 - Add new tags, such as <audio>, <video>, <canvas>, - Specifies scripting API that can be used with Javascript * Canvas element for 2D drawing * Web Storage for local data storage * Offline Web Application for offline app support * Document Editing and Drag-and-Drop * - Detailed rules on how to interpret HTML document and handle errors * Ensures that different browsers produce the same results in case of error Cascading Style Sheet Standard language for specifying document formatting and presentation A set of rules. Rule = selector + declaration block Example: http://oak.cs.ucla.edu/cs144/examples/example.css CSS page: p, h2 { <-- beginning of rule. selector and declaration block font-family: "Tahoma", serif; <-- (property, value) pair color: black; background-color: white;.note { <-- for class "note" <h3 class="note"> color: red; border: 1px solid black; background-color: yellow; font-weight: bold; p.warning { <-- for <p> element with "warning" class color: red; #paragraph1 { <-- for element with id "paragraph1" <p id="paragraph1> margin: 0; h2 p { <-- for <p> only if it is a descendent of <h2> color: red; Web page: 7

<link rel="stylesheet" href="example.css" type="text/css"> - "tag" an element or a set of elements using <span> or <div> - <span>: within a single element (inline element) - <div>: around a set of elements. breaks the line at the end (block-level element) - It is also possible to directly embed CSS as part of HTML document like: <style type="text/css"> @import "example.css"; </style> Note: In practice, hundreds of bugs even for the most popular browsers - CSS filter: exploit CSS bugs to make sure to apply certain CSS rules to only a particular browser family. * Any property name starting with * is recognized by IE7 and below, nothing else. 8

HTML Forms <form>, <input>: an intuitive interface to get user's input - a <form> consists of multiple <input>'s Google search box example at http://oak.cs.ucla.edu/cs144/examples/form.html -- initial request --> client <- form page --------- server -- request w input --> <-- result ----------- <form action="http://www.google.com/search" method="get"> <input name="q" type="text"><input type="submit"> </form> <input> - many "type"s: text, textarea, checkbox, radio, password, file, hidden, submit... - name and value pair: q=user_input <form> - action: the destination of data (or the location of the server process) METHOD - most common: * GET: "retrieve" a resource (no side effect) IMPORTANT: GET should not have any significant side effect at server input values are encoded within URL e.g. http://www.google.com/search?q=yahoo * POST: "post" data through the specified URL input values are encoded in the body of the request show example packets generated from http://oak.cs.ucla.edu/cs144/examples/post.html e.g. POST /search HTTP/1.0... Content-Type: application/x-www-form-urlencoded Content-Length: 7... q=yahoo - less common: HEAD: the same but the header only PUT: "place" the data at the URL (~ replace the data) DELETE: "delete" the resource at the URL OPTIONS: requests for information on available options at the server TRACE: the final recipient returns the whole request message in the response body o Q: When will it be useful? 9