BACKGROUND. HTTP is a 2-phase protocol used by most web applications and all web browsers. The response is usually an HTML document

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

HTML: Parsing Library

HTML: Parsing Library

The [HTML] Element p. 61 The [HEAD] Element p. 62 The [TITLE] Element p. 63 The [BODY] Element p. 66 HTML Elements p. 66 Core Attributes p.

A HTML document has two sections 1) HEAD section and 2) BODY section A HTML file is saved with.html or.htm extension

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

Certified HTML5 Developer VS-1029

Index. CSS directive, # (octothorpe), intrapage links, 26

Certified HTML Designer VS-1027

Oliver Pott HTML XML. new reference. Markt+Technik Verlag

2.1 Origins and Evolution of HTML

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

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

Copyright 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 2 Introduction to XHTML

2.1 Origins and Evolution of HTML. 2.3 HTML Document Structure

QUICK REFERENCE GUIDE

Canvas & Brush Reference. Source: stock.xchng, Maarten Uilenbroek

INTRODUCTION TO HTML5! HTML5 Page Structure!

CSC Web Programming. Introduction to HTML

ROLE OF WEB BROWSING LAYOUT ENGINE EVALUATION IN DEVELOPMENT

A Brief Introduction to HTML

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

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

HTML Markup for Accessibility You Never Knew About

recall: a Web page is a text document that contains additional formatting information in the HyperText Markup Language (HTML)

Designing UI. Mine mine-cetinkaya-rundel

Evaluation of alignment methods for HTML parallel text 1

5-Sep-16 Copyright 2016 by GemTalk Systems LLC 1

HTML CS 4640 Programming Languages for Web Applications

<page> 1 Document Summary Document Information <page> 2 Document Structure Text Formatting <page> 3 Links Images <page> 4

Cascading Style Sheet

CSC 121 Computers and Scientific Thinking

2.1 Origins and Evolution of HTML

Chapter 1 Self Test. LATIHAN BAB 1. tjetjeprb{at}gmail{dot}com. webdesign/favorites.html :// / / / that houses that information. structure?

2.1 Origins and Evolution of HTML

HTML Cheat Sheet for Beginners

HTML and CSS COURSE SYLLABUS

HTML Hyper Text Markup Language

UNIT II Dynamic HTML and web designing

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

By Ryan Stevenson. Guidebook #2 HTML

INFS 2150 / 7150 Intro to Web Development / HTML Programming

Beginning Web Programming with HTML, XHTML, and CSS. Second Edition. Jon Duckett

A Balanced Introduction to Computer Science, 3/E

Web Designing HTML5 NOTES

Programming of web-based systems Introduction to HTML5

Review of HTML. Chapter Pearson. Fundamentals of Web Development. Randy Connolly and Ricardo Hoar

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0

Basics of Web Design, 3 rd Edition Instructor Materials Chapter 2 Test Bank

Symbols INDEX. !important rule, rule, , 146, , rule,

Wireframe :: tistory wireframe tistory.

Tutorial 2 - HTML basics

"utf-8";

Understanding this structure is pretty straightforward, but nonetheless crucial to working with HTML, CSS, and JavaScript.

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

As we design and build out our HTML pages, there are some basics that we may follow for each page, site, and application.

Structure Bars. Tag Bar

Web Development & Design Foundations with HTML5 & CSS3 Instructor Materials Chapter 2 Test Bank

Internet publishing HTML (XHTML) language. Petr Zámostný room: A-72a phone.:

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

Html basics Course Outline

Markup Language SGML: Standard Generalized Markup Language. HyperText Markup Language (HTML) extensible Markup Language (XML) TeX LaTeX

CSE 3. Marking Up with HTML. Comics Updates Shortcut(s)/Tip(s) of the Day Google Earth/Google Maps ssh Anti-Spyware

@namespace url( /* set default namespace to HTML */ /* bidi */

ID1354 Internet Applications

Hyper Text Markup Language HTML: A Tutorial

5/17/2009. Marking Up with HTML. An HTML Web Page File. Tags for Bold, Italic, and underline. Structuring Documents

Inline Elements Karl Kasischke WCC INP 150 Winter

Table-Based Web Pages

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

COMP519: Web Programming Lecture 4: HTML (Part 3)

HTML + CSS. ScottyLabs WDW. Overview HTML Tags CSS Properties Resources

HTML TUTORIAL ONE. Understanding What XHTML is Not

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

HTML+ CSS PRINCIPLES. Getting started with web design the right way

CSC Web Technologies, Spring HTML Review

GRAPHIC WEB DESIGNER PROGRAM

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

Creating Web Pages. Getting Started

More about HTML. Digging in a little deeper

Programmazione Web a.a. 2017/2018 HTML5

Deccansoft Software Services

The figure below shows the Dreamweaver Interface.

HTML. Based mostly on

13.8 How to specify alternate text

Selected Sections of Applied Informatics

Layout Manager - Toolbar Reference Guide

Chapter 4: Marking Up With HTML: A Hypertext tmarkup Language Primer

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

HYPERTEXT MARKUP LANGUAGE ( HTML )

Static Webpage Development

CPET 499/ITC 250 Web Systems. Topics

Creating Web Pages Using HTML

HTML. HTML Evolution

1.264 Lecture 12. HTML Introduction to FrontPage

LING 408/508: Computational Techniques for Linguists. Lecture 14

ICT IGCSE Practical Revision Presentation Web Authoring

Name Related Elements Type Default Depr. DTD Comment

COMP519 Web Programming Lecture 3: HTML (HTLM5 Elements: Part 1) Handouts

SilkTest 2009 R2. Rules for Object Recognition

Transcription:

HTML

2 BACKGROUND HTTP is a 2-phase protocol used by most web applications and all web browsers REQUEST: a client/browser asks a server for a resource RESPONSE: the server responds with the resource The response is usually an HTML document An HTML document is plain text An HTML document may reference other resources Images Scripts Fonts Video Stylesheets

3 INTRODUCTION When a user types a URL, the browser creates an HTTP request for the document The server responds with the document. The document has content : the data of the document. structure : relationships between content style : how the content is displayed / rendered The browser generates requests for any resources that the document requires images scripts fonts The browser renders the document For each data element determines the size, location, color, etc.. of the element The document is then turned into pixels and shown on the screen.

4 DOCUMENT CONTENT Essays in the art of writing. By Robert Louis Stevenson On Some Technical Elements of Style in Literature Title Attribution Chapter There is nothing more disenchanting to man than to be shown the springs and mechanism of any art. All our arts and occupations lie wholly on the surface; it is on the surface that we perceive their beauty, fitness, and significance; and to pry below is to be appalled by their emptiness and shocked by the coarseness of the strings and pulleys. In a similar way, psychology itself, when pushed to any nicety, discovers an abhorrent baldness, but rather from the fault of our analysis than from any poverty native to the mind. And perhaps in aesthetics the reason is the same: those disclosures which seem fatal to the dignity of art seem so perhaps only in the proportion of our ignorance; and those conscious and unconscious artifices which it seems unworthy of the serious artist to employ were yet, if we had the power to trace them to their springs, indications of a delicacy of the sense finer than we conceive, and hints of ancient harmonies in nature. This ignorance at least is largely irremediable. We shall never learn the affinities of beauty, for they lie too deep in nature and too far back in the mysterious history of man. The amateur, in consequence, will always grudgingly receive details of method, which can be stated but never can wholly be explained; nay, on the principle laid down in Hudibras, that Still the less they understand, The more they admire the sleight-of-hand, Paragraph Quotation

5 DOCUMENT STRUCTURE Essays in the art of writing. By Robert Louis Stevenson On Some Technical Elements of Style in Literature There is nothing more disenchanting to man than to be shown the springs and mechanism of any art. All our arts and occupations lie wholly on the surface; it is on the surface that we perceive their beauty, fitness, and significance; and to pry below is to be appalled by their emptiness and shocked by the coarseness of the strings and pulleys. In a similar way, psychology itself, when pushed to any nicety, discovers an abhorrent baldness, but rather from the fault of our analysis than from any poverty native to the mind. And perhaps in aesthetics the reason is the same: those disclosures which seem fatal to the dignity of art seem so perhaps only in the proportion of our ignorance; and those conscious and unconscious artifices which it seems unworthy of the serious artist to employ were yet, if we had the power to trace them to their springs, indications of a delicacy of the sense finer than we conceive, and hints of ancient harmonies in nature. This ignorance at least is largely irremediable. We shall never learn the affinities of beauty, for they lie too deep in nature and too far back in the mysterious history of man. The amateur, in consequence, will always grudgingly receive details of method, which can be stated but never can wholly be explained; nay, on the principle laid down in Hudibras, that The document elements are related to each other in specific ways. The document contains a title followed by a chapter. The title contains an author. The chapter contains a paragraph and a quotation. Still the less they understand, The more they admire the sleight-of-hand,

6 DOCUMENT STYLE Essays in the art of writing. By Robert Louis Stevenson On Some Technical Elements of Style in Literature There is nothing more disenchanting to man than to be shown the springs and mechanism of any art. All our arts and occupations lie wholly on the surface; it is on the surface that we perceive their beauty, fitness, and significance; and to pry below is to be appalled by their emptiness and shocked by the coarseness of the strings and pulleys. In a similar way, psychology itself, when pushed to any nicety, discovers an abhorrent baldness, but rather from the fault of our analysis than from any poverty native to the mind. And perhaps in aesthetics the reason is the same: those disclosures which seem fatal to the dignity of art seem so perhaps only in the proportion of our ignorance; and those conscious and unconscious artifices which it seems unworthy of the serious artist to employ were yet, if we had the power to trace them to their springs, indications of a delicacy of the sense finer than we conceive, and hints of ancient harmonies in nature. This ignorance at least is largely irremediable. We shall never learn the affinities of beauty, for they lie too deep in nature and too far back in the mysterious history of man. The amateur, in consequence, will always grudgingly receive details of method, which can be stated but never can wholly be explained; nay, on the principle laid down in Hudibras, that Still the less they understand, The more they admire the sleight-of-hand, Large bold underlined Small all-caps gray Medium bold blue Small black Small italic indented

7 RENDERED DOCUMENT The browser takes the content, structure, and style information and 'renders' the document. This is the result.

8 HTML DOCUMENTS HTML documents: Hypertext markup language hypertext : links markup language : the content is marked up with tags that describe the documents structure The structure is hierarchical HTML documents are Plain text documents Content is typed in with a plain-text word processor Content is tagged tags are typed in with a plain-text word processor HTML documents are all about semantics Not concerned with looks All about meaning CSS is all about style

9 HTML SYNTAX HTML documents are composed of elements Also known as tags Content is tagged to describe it s meaning within the document. TAG_START TAGGED_CONTENT TAG_END You might tag the content as an article <article> this is the article </article>

10 HTML SYNTAX A tag is always written like: Notes on tags Tags contain an element name. The tag above is the p or paragraph element. A tag has both a start and a close. The closing tag is denoted by the two-character sequence </. Some tags (just a few) don t need to be closed. There is a well-defined set of element names in HTML. You cannot invent your own.

11 HTML SYNTAX Tags define the structure of the content Tags declare the semantic meaning of the content Tags describe how content is related to other content via nesting Tags are not case sensitive. Each of the following are semantically equal. <BODY> <Body> <body> <body> We should always use lower-case anyway. <body> NOT <BODY> NOT <BoDy>

12 DOCUMENT STRUCTURE Tags define the structure of a document by nesting. Each tag must be fully contained within a parent tag. Tags are related to each other as parent : If A contains B without another tag between them, A is the parent of B. child : If B is contained by A without another tag between them, B is the child of A. sibling : If A and B have the same parent, A and B are siblings.

13 EXAMPLE OF DOCUMENT STRUCTURE

14 HTML SYNTAX : ATTRIBUTES Tags may have attributes <tagname att1="val1" att2="val2" > An attribute is always written as an attribute-name followed by an equal symbol (=) followed by text in double-quotes (this is the value). name= value Each element has a well-defined set of attribute names. You can t invent your own.

15 DOCUMENT STRUCTURE <div>essays in the art of writing. </div> <h6>by Robert Louis Stevenson</h6> <div class="chapter">on Some Technical Elements of Style in Literature <p>there is nothing more disenchanting to man than to be shown the springs and mechanism of any art. All our arts and occupations lie wholly on the surface; it is on the surface that we perceive their beauty, fitness, and significance; and to pry below is to be appalled by their emptiness and shocked by the coarseness of the strings and pulleys. In a similar way, psychology itself, when pushed to any nicety, discovers an abhorrent baldness, but rather from the fault of our analysis than from any poverty native to the mind. And perhaps in aesthetics the reason is the same: those disclosures which seem fatal to the dignity of art seem so perhaps only in the proportion of our ignorance; and those conscious and unconscious artifices which it seems unworthy of the serious artist to employ were yet, if we had the power to trace them to their springs, indications of a delicacy of the sense finer than we conceive, and hints of ancient harmonies in nature. This ignorance at least is largely irremediable. We shall never learn the affinities of beauty, for they lie too deep in nature and too far back in the mysterious history of man. The amateur, in consequence, will always grudgingly receive details of method, which can be stated but never can wholly be explained; nay, on the principle laid down in Hudibras, that</p> Starting with just the words of the document, the structure and style are indicated with "markup" (also known as "tags"). </div> <q> Still the less they understand, The more they admire the sleight-of-hand, </q>

16 SPACES, TABS, NEWLINES <div>essays in the art of writing.<h6>by Robert Louis Stevenson</h6></div><div class="chapter">on Some Technical Elements of Style in Literature<p>There is nothing more disenchanting to man than to be shown the springs and mechanism of any art. All our arts and occupations lie wholly on the surface; it is on the surface that we perceive their beauty, fitness, and significance; and to pry below is to be appalled by their emptiness and shocked by the coarseness of the strings and pulleys. In a similar way, psychology itself, when pushed to any nicety, discovers an abhorrent baldness, but rather from the fault of our analysis than from any poverty native to the mind. And perhaps in aesthetics the reason is the same: those disclosures which seem fatal to the dignity of art seem so perhaps only in the proportion of our ignorance; and those conscious and unconscious artifices which it seems unworthy of the serious artist to employ were yet, if we had the power to trace them to their springs, indications of a delicacy of the sense finer than we conceive, and hints of ancient harmonies in nature. This ignorance at least is largely irremediable. We shall never learn the affinities of beauty, for they lie too deep in nature and too far back in the mysterious history of man. The amateur, in consequence, will always grudgingly receive details of method, which can be stated but never can wholly be explained; nay, on the principle laid down in Hudibras, that</p><q> Still the less they understand, The more they admire the sleight-ofhand, </q></div> Note that spaces and newlines don't often make a difference. Typing this into a file will be rendered exactly the same as the previous example; it's just harder to read the HTML directly (which doesn t really matter anyway).

17 SYNTAX AND TAGS HTML5 has rules about how to mark-up data. It has a well-defined set of element names. You must use only those elements defined by the standard. Each element has a semantic specification that defines when it should be used. Some elements have constraints on what they may contain. You must follow the specification as it relates to the hierarchical document structure. Each element has a well defined set of attribute names. You must use only those attribute names. Each element attribute has a well-defined set of values. You must use only those attribute values. HTML Syntax describes the rules for writing correct HTML. The rest of this presentation describes HTML 5 Syntax.

18 HTML TAGS There are over 100 tags in HTML5. They can be grouped as follows Structure: html, head, body, div, span Text: p, h1-h6, strong, em, abbr, acronym, address, bdi, bdo, blockquote, cite, q, code, ins, del, dfn, kbd, pre, samp, var, br, sub, sup, b, i, big, small, hr, pre Links: a, base Images and Objects: img, area, map, object, param Lists: uo, ol, li, dl, dt, dd Tables: table, tr, td, th, tbody, thead, tfoot, col, colgroup, caption Forms: form, input, textarea, select, option, optgroup, button, label, fieldset, legend

19 STARTING TEMPLATE Every document must have the following at minimum DOCTYPE. Specifies an "HTML 5" document. <html> Is the root element. There must only be one html element in the document. The html element Must have exactly two children in the following order <head> <body> <head> There must be only one head element. The head must have a title. The title must not be empty. Other elements are allowed and may occur in any order. <body> There must be only one body in the entire document. The body is always the second child of the html element. <!DOCTYPE html> <html> <head> <title>title</title> </head> <body> </body> </html>

20 NOTES ABOUT APPEARANCE HTML typically ignores spaces and new-lines that you type. The following two tags appear the same in the browser. <span>this has a lot of spaces.</span> <span>this has a lot of spaces.</span> HTML also has default style rules for each element. We will discuss style later; but for now notice that tags are either: BLOCK: the tag is separated from surrounding elements by empty space (like a blank line has been inserted) INLINE: the tag is not separated from surrounding elements. No visible indication that there is a separate "thing" in the document.

21 GENERIC STRUCTURAL ELEMENTS

22 HEADINGS

23 SECTION

24 ARTICLE

25 PARAGRAPH

26 QUOTATION

27 BLOCKQUOTE

28 BLOCKQUOTE

29 ADDRESS

30 CODE

31 FIGURE

32 ANCHORS

33 IMAGES Web browsers have support for images in many formats. The most common are: GIF 8 bit color (usually lossy) Small file size Use for logos/icons JPEG 24 bit color (usually lossy) Good compression Use for photos PNG 24 bit color with better transparency support than JPEG Good compression Use for photos

34 IMAGES

35 IMAGES

36 PREFORMATTED

37 A SIDENOTE Let's write an HTML page that describes HTML tags. <body> <p> The <div> tag represents the generic block-level structuring element in HTML 5. You should only use <div> when no specific alternative is available. </p> </body>

38 ENTITIES Some characters have a special meaning "<" indicates the start of an element (or tag) How to put a < in a paragraph of text? Create a page that contains the text "x < y". Result Description Entity Name Entity Number non-breaking space < less than < < > greater than > > & ampersand & & cent pound yen euro section copyright registered trademark

39 LISTS There are three kinds of HTML lists UL : an unordered list of items order of the items is not meaningful rendered with bullets items are tagged with <LI> OL : an ordered list of items order of the items is meaningful rendered with numbers items are tagged with <LI> DL : a description list a list of terms and their descriptions/definitions Contains only dt and dd elements

40 LISTS

41 LISTS

42 LISTS

43 LISTS

44 LISTS

45 FORMS An HTML form contains elements that obtain data from users. Different types of input : text, numbers, dates, others Need to know where to submit the data Need to know when to submit the data Need to know how to submit the data A form defines the specific inputs where to submit the data when to submit the data how to submit the data

46 FORMS

47 FORM ATTRIBUTES A single page may contain numerous forms A form may contain any valid html tables, articles, sections, lists, With respect to the function of the form input elements : gather the user data action attribute : where to submit the data submit button : when to submit the data method attribute : how to submit the data

48 INPUT

49 INPUTS Form data is sent to the server as name-value pairs. The input elements control the name-value pairs. name attribute : names the datum value : data entered by the user value attribute : provides initial value When the above form is submitted, the web server would receive the following information first_name="jackie" last_name="chan" email="jchan@gmail.com"

50 RADIO INPUTS Consider the following form fragment. How to enforce the single selection constraint? Write an HTML fragment that generates the above. Modify the HTML fragment so that the user is allowed to choose as many toppings as desired.

51 SELECT : A NON-INPUT INPUT

52 TEXTAREA : A NON-INPUT INPUT

53 TABLE OVERVIEW A table is a grid of data. A table can only contain A <caption> (optional) Any valid html A <colgroup> (optional) contains only <col> children <col> supports a span attribute A <thead> (optional) contains only <tr> children A <tfoot> (optional) contains only <tr> children A <tbody> (mandatory but supplied if not provided) Contains only <tr> children Contains only <th> and <td> children These can contain any valid html

54 TABLE

55 TABLE

56 TABLE EXAMPLE <table border = "border"> <caption> Fruit Juice Drinks </caption> <tr> <th> </th> <th> Apple </th> <th> Orange </th> <th> Screwdriver </th> </tr> <tr> <th> Breakfast </th> <td> 0 </td> <td> 1 </td> <td> 0 </td> </tr> <tr> <th> Lunch </th> <td> 1 </td> <td> 0 </td> <td> 0 </td> </tr> </table>

57 SPANNING ROWS/COLUMNS Table cells (td/th) can span multiple columns and/or rows. This is controlled by the following attributes colspan : the number of columns that the cell spans rowspan : the number of rows that the cell spans Example <td colspan="2" rowspan="2">some data</td>

58 TABLE EXAMPLE <table border = "border"> <tr> <th></th> <th colspan= 3 >Fruit Juice Drinks</th> </tr> <tr> <th> </th> <th> Apple </th> <th> Orange </th> <th> Screwdriver </th> </tr> <tr> <th> Breakfast </th> <td> 0 </td> <td> 1 </td> <td> 0 </td> </tr> <tr> <th> Lunch </th> <td> 1 </td> <td> 0 </td> <td> 0 </td> </tr> </table>

59 BREAK

60 HR

61 TEXT-LEVEL <b> Indicates text that is stylistically distinct from normal text. Does not mean bold but usually does <em> Emphasized text. Nesting level indicates increased importance. <i> Indicates text in an alternate voice such as technical terms, foreign transliterations, or italicized text. <strong> Indicates string importance. <mark> highlighted text. Often used for search results.

62 TEXT-LEVEL <s> Represents text that is no longer accurate or relevant Usually rendered as strike-through <u> Represents an unarticulated, non-textual annotation. Use for mis-spellings, proper names in Chinese prose, etc.. i.e. underlined : <small> Represents side comments (inline). Should be used for short text fragments. <aside> A section of a page that is tangentially related to the surrounding content. Often used of side-bars or sidenavigation.

63 TEXT-LEVEL <dfn> Represents the defining instance of a term. In other words, it is the term that is later defined. <p>the <dfn>www</dfn> is a global computer network.</p> <sup> & <sub> Represents superscripts (sup) and subscripts (sub) <time> Represents either a date or a time in the Gregorian calendar <var> A variable <var>e</var> = <var>m</var><var>c<var><sup>2</sup> <samp> Sample output from a computer program. <span> The generic inline element. Only use if no other inline element is appropriate