(X)HTML ICS213, 1 / 2011 Dr. Seung Hwan Kang 1. Outline HTML 4.01 XHTML HTML 5.

Slides:



Advertisements
Similar presentations
HTML/XML XHTML Authoring. Creating Tables  Table: An arrangement of horizontal rows and vertical columns. The intersection of a row and a column is called.
Advertisements

Chapter 4 Marking Up With Html: A Hypertext Markup Language Primer.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Cos 381 Day 2.
Markup Languages Controlling the Display Of Web Content.
Chapter 2 © 2005 by Addison Wesley Longman, Inc Origins and Evolution of HTML - HTML was defined with SGML - Original intent of HTML: General layout.
XHTML1 Tables and Lists. XHTML2 Objectives In this chapter, you will: Create basic tables Structure tables Format tables Create lists.
Cos 381 Day 2. © 2006 Pearson Addison-Wesley. All rights reserved. 2-2 Agenda Question Resources –Zip file of all textbook examples in webCT
Database-Driven Web Sites, Second Edition1 Chapter 2 INTRODUCTION TO HTML.
Chapter 2 © 2002 by Addison Wesley Longman, Inc. 1 Chapter 2 Sebesta: Programming the World Wide Web.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Table, Forms, Metatags and Frames.
1 XHTML Tables A table is a matrix of cells, for displaying content in rows and columns The cells can include almost any element Some cells display row.
Chapter 4 Fluency with Information Technology L. Snyder Marking Up With HTML: A Hypertext Markup Language Primer.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Fluency with Information Technology Third Edition by Lawrence Snyder Chapter.
Chapter 2 HTML (Hypertext Markup Language) Part I.
Chapter 2 Introduction to XHTML. © 2006 Pearson Addison-Wesley. All rights reserved Origins and Evolution of HTML - HTML was defined with SGML.
Dr. Ahmet Cengizhan Dirican BIL 374 Internet Technologies 2. XHTML.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Introduction to XHTML.
HTML & XHTML TAGS. Origins and Evolution of HTML HTML was defined with SGML Original intent of HTML: General layout of documents that could be displayed.
1 Forms A form is the usual way that information is gotten from a browser to a server –HTML has tags to create a collection of objects that implement this.
Chapter 2 © 2003 by Addison-Wesley, Inc Origins and Evolution of HTML - Derived from SGML - Original intent: General layout of documents that could.
Chapter 2 Introduction to XHTML Origins and Evolution of HTML - HTML was defined with SGML - Original intent of HTML: General layout of documents.
Dr. Nuha El-KhaliliInternet Programming ( ) HTML Hyper Text Markup Language The language of web pages Maintained by the W3C
Chapter 4: Hypertext Markup Language Primer TECH Prof. Jeff Cheng.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML Pt. 2.
4410/5410 – Web Technologies Class Introduction Extensible HyperText Markup Language –XHTML –A markup language –Separation of the presentation of a document.
1 CSC 121 Computers and Scientific Thinking David Reed Creighton University HTML and Web Pages.
CP476 Internet Computing Lecture 7 HTML 1 What is HTML? HyperText Markup Language (HTML) is an application of Standard Generalized Markup Language (SGML)
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Introduction to XHTML.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
INTRODUCTION. What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is not a programming language,
Designing a Web Page with Tables. A text table: contains only text, evenly spaced on the Web page in rows and columns uses only standard word processing.
Chapter 2 XHTML: Part II The Web Warrior Guide to Web Design Technologies.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
2.2 XHTML (cont.). Motto Yea, from the table of my memory I’ll wipe away all trivial fond records. —William Shakespeare.
XHTML 1.1  Derived from Standard Generalized Markup Language (SGML) of ISO  XHTML concerned primary with content rather than presentation and style 
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.
Chapter 2 Introduction to XHTML. © 2006 Pearson Addison-Wesley. All rights reserved Origins and Evolution of HTML - HTML was defined with SGML.
HTML Forms A Preliminary Step into Dynamic Web Fred Durao
TJ 3043 – Web Application Development HTML Form. 2.0 Forms A form is the usual way to communicate information from a Web browser to a server HTML has.
CP102 Module 7: HTML 1 Module 7: HTML 1.What is 1.What is HTML? 2. 2.Basic syntax, document structure 3. 3.Basic formatting, images, links 4. 4.Lists,
TJ 3043 – Web Application Development HTML Form. 2.0 Forms - A form is the usual way information is gotten from a browser to a server - HTML has tags.
Lecture 6 More Advanced HTML Boriana Koleva Room: C54
CSE 409 – Advanced Internet Technology 1 DISCUSSION OF BASIC HTML TAGS.
Chapter 2 © 2014 by Pearson Education Origins and Evolution of HTML - HTML was defined with SGML - Original intent of HTML: General layout of documents.
Chapter 2 Introduction to XHTML. HTML was defined with SGML Original intent of HTML: General layout of documents that could be displayed by a wide variety.
Dr. Ahmet Cengizhan Dirican BIL 374 Internet Technologies 2. XHTML.
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.
20-753: Fundamentals of Web Programming 1 Lecture 6: Advanced HTML Fundamentals of Web Programming Lecture 6: Advanced HTML.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
CS3101 Internet Programming. Chapter 01 Introduction to XHTML 2Internet Programming - Chapter 01:XHTML Slides based on: Programming the World Wide Web.
1999, COMPUTER SCIENCE, BUU Introduction to HTML Seree Chinodom
INT222 – Internet Fundamentals
Chapter 2 © 2009 by Addison Wesley Longman, Inc Origins and Evolution of HTML - HTML was defined with SGML - Original intent of HTML: General layout.
HTML AN INTRODUCTION TO WEB PAGE PROGRAMMING. INTRODUCTION TO HTML With HTML you can create your own Web site. HTML stands for Hyper Text Markup Language.
COM621: Advanced Interactive Web Development Lecture 1 – XHTML.
 Derived from SGML  Original intent: General layout of documents that could be displayed by a wide variety of computers  HTML standards by W3C: › The.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 1 Using HTML to Create Web Pages.
Marking Up with XHTML Tags describe how a web page should look
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
Chapter 5 Introduction to XHTML: Part 2
2.1 Origins and Evolution of HTML
2.1 Origins and Evolution of HTML
Marking Up with XHTML Tags describe how a web page should look
Marking Up with XHTML Tags describe how a web page should look
1 Introduction to XHTML.
Marking Up with XHTML Tags describe how a web page should look
Marking Up with XHTML Tags describe how a web page should look
Marking Up with XHTML Tags describe how a web page should look
Presentation transcript:

(X)HTML ICS213, 1 / 2011 Dr. Seung Hwan Kang 1

Outline HTML 4.01 XHTML HTML 5

Origins and Evolution of HTML HTML was defined with SGML (Standard Generalized Markup Language) Original intent of HTML: General layout of documents that could be displayed by a wide variety of computers 3

Origins and Evolution of HTML HTML 4.0 – 1997 Introduced many new features and deprecated many older features HTML A cleanup of 4.0 XHTML Just 4.01 defined using XML, instead of SGML XHTML 1.1 – 2001 Modularized 1.0, and drops frames HTML 5 Working draft 25 March 2011 Defining clear conformance criteria for user agents in an effort to improve interoperability 4

Reasons to use XHTML, rather than HTML HTML has lax syntax rules, leading to sloppy and sometime ambiguous documents XHTML syntax is much more strict, leading to clean and clear documents in a standard form HTML processors do not even enforce the few syntax rule that do exist in HTML The syntactic correctness of XHTML documents can be validated 5

Reasons not to use XHTML but Internet Explorer doesn't support XHTML but Firefox can't do incremental rendering of XHTML but so many user agents can handle HTML and elements in XHTML sent as text/html have to be escaped using ridiculously complicated strings */--> 6

W3C HTML Validation Service 7

HTML 4.01 Basic Syntax Tag format: Opening tag: Closing tag: The opening tag and its closing tag together specify a container for the content they enclose Hello World! 8

Not all tags have content If a tag has no content, its form is The container and its content together are called an element If a tag has attributes, they appear between its name and the right bracket of the opening tag Hello World! Comment form: Browsers ignore comments, unrecognizable tags, line breaks, multiple spaces, and tabs 9 greet.html XHTML Not supported in HTML 5

HTML Document Structure Every HTML document must begin with:,,, and are required in every document The whole document must have as its root A document consists of a head and a body The tag is used to give the document a title, which is normally displayed in the browser’s window title bar (at the top of the display) 10

HTML 4.01 Our first HTML 4 document TODO write content 11

XHTML 1.0 Our first XHTML document TODO write content

HTML 5 Our first HTML 5 document TODO write content

Paragraph Tag Text is normally placed in paragraph elements The tag breaks the current line and inserts a blank line - the new line gets the beginning of the content of the paragraph The browser puts as many words of the paragraph’s content as will fit in each line 14 greet.html

Line breaks Tag The effect of the tag is the same as that of, except for the blank line No closing tag! 15

Our first document On the plains of hesitation bleach the bones of countless millions who, at the dawn of victory sat down to wait, and waiting, died! - George W. Cecil 16 br.html

Heading Tag Six sizes, 1 - 6, specified with to 1, 2, and 3 use font sizes that are larger than the default font size 4 uses the default size 5 and 6 use smaller font sizes 17 headings.html

Blockquote Tag Content of To set a block of text off from the normal flow and appearance of text Browsers often indent, and sometimes italicize 18 blockquote.html

Font Tag Font Styles and Sizes (can be nested) Boldface - Italics - Larger - Smaller - Monospace - Subscripts with Superscripts with All of this font size and font style stuff can be done with cascading style sheets, but these tags are not yet deprecated Not supported in HTML 5 19 font.html

Horizontal rule Tag draws a line across the display, after a line break The meta element (for search engines) Used to provide additional information about a document, with attributes, not content 20

21 Some commonly used entities

Image Tag GIF (Graphic Interchange Format) 8-bit color (256 different colors) JPEG (Joint Photographic Experts Group) 24-bit color (16 million different colors) Both use compression, but JPEG compression is better Portable Network Graphics (PNG) Relatively new Should eventually replace both.gif and.jpeg 22

Image Tag Images are inserted into a document with the tag with the src attribute The alt attribute is required by XHTML Purposes: 1. Non-graphical browsers 2. Browsers with images turned off The tag has 30 different attributes, including width and height (in pixels) 23 image.html

Hypertext Link Tag Hypertext is the essence of the Web! A link is specified with the href (hypertext reference) attribute of (the anchor tag) The content of is the visual link in the document If the target is a whole document (not the one in which the link appears), the target need not be specified in the target document as being the target Note: Relative addressing of targets is easier to maintain and more portable than absolute addressing 24

Links Aidan's Airplanes The best in used airplanes "We've got them by the hangarful" Special of the month 1960 Cessna 210 Information on the Cessna link.html

Hypertext Link Tag (cont’d) If the target is not at the beginning of the document, the target spot must be marked Target labels can be defined in many different tags with the id attribute, as in Baskets The link to an id must be preceded by a pound sign ( # ); If the id is in the same document, this target could be What about baskets? If the target is in a different document, the document reference must be included Baskets 26

Hypertext Link Tag (cont’d) Style note: a link should blend in with the surrounding text, so reading it without taking the link should not be made less pleasant Links can have images: Info on C210 27

Unordered List Tag The list is the content of the tag List elements are the content of the tag Some Common Single-Engine Aircraft Cessna Skyhawk Beechcraft Bonanza Piper Cherokee 28 unordered.html

Ordered List Tag The list is the content of the tag Each item in the display is preceded by a sequence value Cessna 210 Engine Starting Instructions Set mixture to rich Set propeller to high RPM Set ignition switch to "BOTH" Set auxiliary fuel pump switch to "LOW PRIME" When fuel pressure reaches 2 to 2.5 PSI, push starter button 29 ordered.html

Nested Lists Tag Any type list can be nested inside any type list The nested list must be in a list item 30 nested_lists.html

Definition List Tag for glossaries, etc. List is the content of the tag Terms being defined are the content of the tag The definitions themselves are the content of the tag Single-Engine Cessna Airplanes 152 Two-place trainer 172 Smaller four-place airplane 182 Larger four-place airplane 210 Six-place airplane - high performance 31 definition.html

Table Tag A table is a matrix of cells, each possibly having content The cells can include almost any element Some cells have row or column labels and some have data A table is specified as the content of a tag A border attribute in the tag specifies a border between the cells If border is set to "border", the browser’s default width border is used The border attribute can be set to a number, which will be the border width Without the border attribute, the table will have no lines! Tables are given titles with the tag, which can immediately follow 32

Table Tag (cont’d) Each row of a table is specified as the content of a tag The row headings are specified as the content of a tag The contents of a data cell is specified as the content of a tag 33 table.html

34 Fruit Juice Drinks Apple Orange Screwdriver Breakfast Lunch 1 0

Table Tag (cont’d) A table can have two levels of column labels If so, the colspan attribute must be set in the tag to specify that the label must span some number of columns Fruit Juice Drinks Orange Apple Screwdriver 35

Table Tag (cont’d) If the rows have labels and there is a spanning column label, the upper left corner must be made larger, using rowspan Fruit Juice Drinks Apple Orange Screwdriver … 36

Table Tag (cont’d) The align attribute controls the horizontal placement of the contents in a table cell Values are left, right, and center (default) align is an attribute of,, and elements The valign attribute controls the vertical placement of the contents of a table cell Values are top, bottom, and center (default) valign is an attribute of and elements The cellspacing attribute of is used to specify the distance between cells in a table The cellpadding attribute of is used to specify the spacing between the content of a cell and the inner walls of the cell 37 cell_align.html

Form Tag A form is the usual way information is gotten from a browser to a server HTML has tags to create a collection of objects that implement this information gathering The objects are called widgets (e.g., radio buttons and checkboxes) When the Submit button of a form is clicked, the form’s values are sent to the server 38

Form Tag (cont’d) All of the widgets, or components of a form are defined in the content of a tag The only required attribute of is action, which specifies the URL of the application that is to be called when the Submit button is clicked action="survey.php" If the form has no action, the value of action is the empty string The method attribute of specifies one of the two possible techniques of transferring the form data to the server, get and post get and post are discussed with PHP 39

Form Tag (cont’d) Widgets Many are created with the tag The type attribute of specifies the kind of widget being created Text Password Checkbox Radio Select Textarea Reset Submit 40

Form Tag (cont’d) Text Creates a horizontal box for text input Default size is 20; it can be changed with the size attribute If more characters are entered than will fit, the box is scrolled (shifted) left If you don’t want to allow the user to type more characters than will fit, set maxlength, which causes excess input to be ignored Login: 41 text.html

Form Tag (cont’d) Password Creates a horizontal box for hidden input Default size is 20; it can be changed with the size attribute If more characters are entered than will fit, the box is scrolled (shifted) left If you don’t want to allow the user to type more characters than will fit, set maxlength, which causes excess input to be ignored Password: 42 text.html

43 Form Tag (cont’d) Checkbox - to collect multiple choice input Every checkbox requires a value attribute, which is the widget’s value in the form data when the checkbox is ‘checked’ A checkbox that is not ‘checked’ contributes no value to the form data By default, no checkbox is initially ‘checked’ To initialize a checkbox to ‘checked’, the checked attribute must be set to ‘checked’ Milk

… Grocery Checklist <input type="checkbox" name ="groceries" value="milk" checked="checked"> Milk <input type="checkbox" name="groceries" value="bread"> Bread <input type="checkbox" name="groceries" value="eggs"> Eggs … 44 checkbox.html

Form Tag (cont’d) Radio Buttons - collections of radio buttons in which only one button can be ‘checked’ at a time Every button in a radio button group MUST have the same name If no button in a radio button group is ‘pressed’, the browser often ‘presses’ the first one <input type="radio" name="age" value="under20" checked="checked"> radio.html

Form Tag (cont’d) Menu - created with tags  There are two kinds of menus, those that behave like checkboxes and those that behave like radio buttons (the default)  Menus that behave like checkboxes are specified by including the multiple attribute, which must be set to "multiple" 46

Form Tag (cont’d) Menu - created with tags  The name attribute of is required  The size attribute of can be included to specify the number of menu items to be displayed (the default is 1)  If size is set to > 1 or if multiple is specified, the menu is displayed as a pop-up menu  Each item of a menu is specified with an tag, whose pure text content (no tags) is the value of the item  An tag can include the selected attribute, which when assigned "selected” specifies that the item is preselected 47

… Grocery Menu - milk, bread, eggs, cheese With size=1 (the default) milk bread eggs cheese … 48 menu.html

Menu (continued) After clicking the menu: After changing size to 2: 49

Form Tag (cont’d) Text area - created with Usually include the rows and cols attributes to specify the size of the text area Default text can be included as the content of Scrolling is implicit if the area is overfilled 50

… Please provide your employment aspirations (Be brief and concise) … 51 textarea.html

Form Tag (cont’d) Reset and Submit buttons Both are created with Submit has two actions: 1.Encode the data of the form 2.Request that the server execute the server-resident program specified as the value of the action attribute of A Submit button is required in every form 52 popcorn.html

Frame Tag Frames are rectangular sections of the display window, each of which can display a different document We will not use it because frames are no longer part of XHTML, you cannot validate a document that includes frames It is not supported in HTML 5 53

Syntactic Differences between HTML & XHTML Case sensitivity Closing tags Quoted attribute values Explicit attribute values id and name attributes Element nesting 54

HTML 4.01 to XHTML 1.0 TODO supply a title TODO write content 55

HTML 5 The new structural elements in HTML 5 consist of the following: It is used to define items displayed in the header of the page It is used to define a generic section of a document or page It is used to specify the items on a page that are associated with a particular content. It is intended to be independently distributable or reusable It is used to define a set of navigational links It is used to define items displayed in the footer of the page 56

HTML 5 (cont’d) In addition to the new structural elements in HTML 5, there are some block-level semantic elements: may used to markup minor components such as sidebars and footnotes. may used to markup images and other embed objects with their descriptive captions. may used to markup the comments in blogs and forum sites. 57

XHTML 1.0 to HTML 5 Your title goes here Header goes here HOME menu 1 Section goes here Article goes here © 2010 ICS313 All rights reserved. 58 html5.html

HTML 5 (cont’d) For multimedia content, sounds, music or other audio streams For video content, such as a movie clip or other video streams For media resources for media elements, defined inside video or audio elements For embedded content, such as a plug-in 59

For multimedia content, sounds, music or other audio streams <audio src="music/sample.ogg" type="audio/ogg" controls="controls" autoplay="autoplay" loop="loop" preload="auto"> Your browser does not support the audio element. 60 audio.html optional

For video content, such as a movie clip or other video streams <video src="sample.ogg" type="video/ogg" width="320" height="240" controls="controls" autoplay="autoplay" loop="loop" preload="auto"> Your browser does not support the video tag. 61 video.html optional

For media resources for media elements, defined inside video or audio elements <audio controls="controls" autoplay="autoplay" loop="loop" preload="auto"> Your browser does not support the audio element. 62 optional source.html

For embedded content, such as a plug-in <embed width="320" height="240" src="video/sample.mov" type="video/quicktime" /> 63 embed.html optional

Web browsers support various Internet media (MIME) types Refers to C:\xampp\apache2\conf\mime.types 64

Questions? 65

References HTML: The Markup Language Reference (2011) World Wide Web Consortium (W3C), Accessed: 25/04/2011. HTML 4.01 Specification (1999) World Wide Web Consortium (W3C), Accessed: 26/01/2010. HTML 5 (2011) World Wide Web Consortium (W3C), Accessed: 13/06/2011. Robert W. Sebesta (2010) Programming the World Wide Web, 5th edn, Pearson/Addison Wesley. (Chapter 3) XHTML™ 1.0 The Extensible HyperText Markup Language (Second Edition) (2002) World Wide Web Consortium (W3C), Accessed: 26/01/