1 COSC 2206 Internet Tools Brief Survey of HTML and XHTML Document Structure Formatting.

Slides:



Advertisements
Similar presentations
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Advertisements

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
Chapter 2 HTML Basics Key Concepts
1. Content – Collective term for all text, images, videos, etc. that you want to deliver to your audience. 2. Structure – How the content is placed on.
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.
Images, Tables, lists, blocks, layout, forms, iframes
17/10/11. 2  The form element ( ) is used to include a number of form elements together so that they can be referenced by some other code in order to.
HTML and XHTML Controlling the Display Of Web Content.
HTML and XHTML Controlling the Display Of Web Content.
Markup Languages Controlling the Display Of Web Content.
XHTML1 Tables and Lists. XHTML2 Objectives In this chapter, you will: Create basic tables Structure tables Format tables Create lists.
Unit 2, cont. September 14 HTML,Validating your pages, Publishing your site.
1 (X)HTML (eXtensible HyperText Markup Language).
XHTML and CSS Overview. Hypertext Markup Language A set of markup tags and associated syntax rules Unlike a programming language, you cannot describe.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Table, Forms, Metatags and Frames.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
Creating a Simple Page: HTML Overview
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
ULI101 – XHTML Basics (Part II) What is Markup Language? XHTML vs. HTML General XHTML Rules Block Level XHTML Tags XHTML Validation.
Chapter 1 Understanding the Web Design Environment Principles of Web Design, 4 th Edition.
Week 1 Understanding the Web Design Environment. 1-2 HTML: Then and Now HTML is an application of the Standard Generalized Markup Language Intended to.
Dr. Nuha El-KhaliliInternet Programming ( ) HTML Hyper Text Markup Language The language of web pages Maintained by the W3C
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML Pt. 2.
HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.
Chapter 1 XHTML: Part I The Web Warrior Guide to Web Design Technologies.
Using Html Basics, Text and Links. Objectives  Develop a web page using HTML codes according to specifications and verify that it works prior to submitting.
1 HTML intro The development of HTMLThe development of HTML The transition from HTML to XHTMLThe transition from HTML to XHTML XHTML syntax, tags, and.
Objectives: 1. Create a Skeleton HTML 2. View a Skeleton File Through a Server and Browser 3. Learn HTML Body Tags for the Display of Text and Graphics.
Learning Web Design: Chapter 4. HTML  Hypertext Markup Language (HTML)  Uses tags to tell the browser the start and end of a certain kind of formatting.
Introduction. Document Structure Overview  XML declaration (prolog)  Document type declaration  Root element (namespace)  Document header  Document.
1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.
Chapter 2 HTML Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
1 Web Developer Foundations: Using XHTML Chapter 2 Key Concepts.
XHTML. Introduction to XHTML What Is XHTML? – XHTML stands for EXtensible HyperText Markup Language – XHTML is almost identical to HTML 4.01 – XHTML is.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
A Basic Web Page. Chapter 2 Objectives HTML tags and elements Create a simple Web Page XHTML Line breaks and Paragraph divisions Basic HTML elements.
XP Tutorial 9 1 Working with XHTML. XP SGML 2 Standard Generalized Markup Language (SGML) A standard for specifying markup languages. Large, complex standard.
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 
XHTML1-1 Extensible HyperText Markup Language (XHTML) Part 2 Xingquan (Hill) Zhu
Lesson 4.
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.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Creating XHTML Documents Essentials for.
COP 3813 Intro to Internet Computing Prof. Roy Levow Lecture 2.
Web Development & Design Foundations with XHTML Chapter 2 HTML/XHTML Basics.
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,
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 2 Key Concepts 1 Copyright © Terry Felke-Morris.
COP 3813 Intro to Internet Computing Prof. Roy Levow Lecture 2.
CSE 409 – Advanced Internet Technology 1 DISCUSSION OF BASIC HTML TAGS.
Copyright © 2003 Pearson Education, Inc. Slide 1-1 Created by Cheryl M. Hughes The Web Wizard’s Guide to XHTML by Cheryl M. Hughes.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Basic Document Structure.
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.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
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
CS3101 Internet Programming. Chapter 01 Introduction to XHTML 2Internet Programming - Chapter 01:XHTML Slides based on: Programming the World Wide Web.
CIS 228 The Internet 9/20/11 XHTML 1.0. “Quirks” Mode Today, all browsers support standards Compliant pages are displayed similarly There are multiple.
INT222 – Internet Fundamentals
Tutorial #1 Using HTML to Create Web Pages. HTML, XHTML, and CSS HTML – HyperText Markup Language The tags the browser uses to define the content of the.
Building a Web Page. A Brief History In 1989, Tim Berners-Lee invented the Web. To enable particle physics from around the world to organize and share.
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.
XHTML Basics.
1 Introduction to XHTML.
Presentation transcript:

1 COSC 2206 Internet Tools Brief Survey of HTML and XHTML Document Structure Formatting

2 W3C HTML Home page W3C is the World Wide Web Consortium and their home page has lots of information, links, and a short history of HTML BGA

3 The HTML 4.01 Specification BGA The World Wide Web Consortium (W3C) is responsible for the HTML specification.

4 The XHTML 1.0 Specification This is the latest specification of HTML that conforms to the XML specification: every XHTML document is also an XML document BGA

5 Web Design Group reference This is a comprehensive reference for HTML 4.01 including a complete description of every HTML tag and its attributes. wdghtml40\index.html BGA local link

6 HTML and XHTML Tutorials Interactive tutorials on HTML and XHTML from w3schools BGA

7 web monkey reference Lots of information here on HTML and web design BGA

8 Document structure (1) Originally HTML was intended as a markup language to describe the logical structure of a document (page description language) The browser would be entirely responsible for the the physical layout and formatting. This didn't happen: Microsoft and Netscape included tags such as and which describe physical formatting HTML became an undesireable mixture of logical structure and formatting. BGA

9 Document structure (2) HTML 3.2 mixed the two concepts together so there are a lot of web pages that contain both logical and physical formatting. Fortunately HTML 3.2 has been replaced by HTML 4 and CSS (cascading styles sheets). Now all physical formatting can be specified by the style sheet. An entire web site can be given a different look just be changing a style sheet. BGA

10 Document Structure (3) All tags that describe physical formatting have been deprecated in HTML 4. Example: and This means that you shouldn't use them in new documents. Document Type Definitions (DTD's) are used to specify a documents type (grammar) For HTML 4 there is the transitional type and the strict type BGA

11 Document Structure (4) The transitional type permits the use of the deprecated tags (elements) The strict type does not allow the use of deprecated tags. Software exists that can validate a document using its DTD. Later we will show how to use it. BGA

12 HTML and XML Recently XML (Extensible Markup Language) has been developed for describing data with user defined tags and attributes. To make HMTL compatible with XML, HTML 4 has been slightly modified so that an HTML document is also an XML document The new HTML is called XHTML 1.0 Version 1.1 now exists too. BGA

13 HTML versions HTML, HTML + HTML 3.2RIP HTML 4 XML XHTML 1.X W3C (World Wide Web Consortium) is responsible for web standards BGA

14 W3C Quote on XHTML "The XHTML family is the next step in the evolution of the internet. By migrating to XHTML today, content developers can enter the XML world with all of its attendant benefits, while still remaining confident in their content's backward and future compatibility." BGA

15 Structure of an HTML4 doc The first line of an HTML 4.01 document should be the document type definition: the DTD. It should be one of the following types Strict Transitional Frameset BGA

16 Strict DTD for HTML4 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" " BGA

17 Transitional DTD for HTML4 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" " /loose.dtd"> BGA

18 Frameset DTD for HTML4 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" " /frameset.dtd"> BGA Frames are not part of the XHTML 1.1 specification. Frames are better done using CSS (cascading style sheets).

19 HTML 4.01 Template <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" " My first HTML document Hello world! tags must be lowercase in XHTML tags must be closed in XHTML htmlTemplate.html BGA

20 Structure of an XHTML doc The first line of an XHTML 1.0 document should be the document type definition: the DTD. It should be one of the following types Strict Transitional Frameset BGA

21 Strict DTD for XHTML 1.0 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " xhtml1-strict.dtd"> BGA

22 Transitional DTD XHTML 1.0 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " xhtml1-transitional.dtd"> BGA

23 Frameset DTD XHTML 1.0 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" " xhtml1-frameset.dtd"> BGA

24 XHTML 1.0 Template DOCTYPE declaration goes here <html xmlns=" xml:lang="en" lang="en"> My first XHTML document Hello world! xhtmlTemplate.html BGA

25 XHTML 1.1 Template <!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.1/EN" "http"// <html xmlns=" xml:lang="en" lang="en"> My first XHTML document Hello world! xhtmlTemplate1.1.html BGA

26 HTML to XHTML (1) Use the XHTML template to make the HTML document into an XML document. Document must be well-formed: illegal nesting is not allowed e.g. text is illegal and must be replaced by text closing tags must not be omitted e.g. paragraph 1 paragraph 2 is illegal and must be replaced by paragraph 1 paragraph 2 BGA

27 HTML to XHTML (2) Tags that are self-closing (empty tags) such as,, and must be written in a special form: e.g. must be written as All tags must be written in lowercase since XML is case sensitive: e.g. must be replaced by BGA

28 HTML to XHTML (3) Attribute values must always be quoted e.g. is illegal and must be replaced by Attribute minimization is not supported e.g. is illegal and must be written as There are a few other rules (see the W3C working XHTML 1.0 draft for details) BGA

29 W3C Validator The W3C has a program that can validate HTML and XHTML based on the document type. You can upload one of your HTML files and have it validated. W3C Validation Service: BGA

30 Kinds of tags in HTML tags with a begin and end tag: In XHTML the ending tag must always be present and the attribute values must always be in quotes... self ending tags: in HTML in XHTML BGA

31 HTML tag summary (1)... create an HTML document... comes before body to specify tags such as,, and... title for browser title bar and favorites list... describes page content and other document info BGA

32 HTML tag summary (2) Meta tag example Here the page is automatically redirected after 5 seconds to the new home page BGA <meta http-equiv=Refresh content= "5; url=

33 HTML tag summary (3)... delimits document content hierarchy of heading levels... bold text (better to use css font-weight)... italic text (better to use css font-style) BGA

34 HTML tag summary (4)... inline monospace ttext (typewriter font) same as creates a citation in italic text... emphasize text: also..... emphasize text BGA

35 HTML tag summary (5)... hypertext link (XHTML form) create a target location within a document... make a link to target location specified by "NAME" in an HMTL document Can also link to a location in another page Ex: " BGA

36 HTML tag summary (6)... define a paragraph (XHTML form) generate a line break... indent displayed text at both margins... define a definition list BGA

37 HTML tag summary (7)... define a name in list to be defined... specify the definition... define an ordered list (numbered list)... define an unordered list (bullet list) BGA

38 HTML tag summary (8)... define a list item in an ordered or unorderd list... define a custom block level division.. define a custom inline text (XHTML form) define an image BGA

39 HTML tag summary (9) (XHTML form) define a horizontal rule. Attributes are deprecated in HTML 4. Use style sheets to specify them.... define a table BGA

40 HTML tag summary (10)... define a table row (many attributes)... define a table header cell (many attributes)... define a table data cell (many attributes)... define a set of frames BGA

41 HTML tag summary (11)... define a frame in a frameset... for browsers that don't support frames... define an interactive form... define a menu BGA

42 HTML tag summary (12) define a menu option (XHTML form)... define a multi-line text input area define a check box (XHTML form) define a radio button (XHTML form) BGA

43 HTML tag summary (13) define a text input box (XHTML form) define a form submit button (XHTML form) define submit button with image (XHTML form) define a form reset button (XHTML form) BGA

44 Comments in HTML Comments begin with Example NEVER USE -- INSIDE A COMMENT. NETSCAPE WILL GET VERY CONFUSED BGA

45 Character entities To use some characters in literal form it is necessary to use character entitles. <<< >>> """ &&& There are many others: search for "character entities" online. BGA

46 HTML Colors see color names are not supported by the W3C standards even though IE and Netscape understand many color names. Correct HTML should use the Color hex codes such as #F0A03F there is also a set of web safe colors that should display properly on any system. BGA

47 The meta tag (1) Used to specify a character encoding in HTML Used to specify client-pull (browser automatically requests a new document from server BGA

48 The meta tag (2) Used to specify when a document should be considered expired Used to specify document language BGA

49 The meta tag (3) Inserting hidden information and data for search engines BGA

50 HTML tables Tables were included in HTML for the presentation of data in tabular form. Tables are also used for page layout. Example: two column layout BGA

51 Examples of tables (1) A simple table with two rows and two columns Cell 1 Cell 2 Cell 3 Cell 4 BGA

52 Examples of tables (2) Previous example with a border Cell 1 Cell 2 Cell 3 Cell 4 BGA

53 Examples of tables (3) Previous example with a border, cellspacing, and cellpadding Cell 1 Cell 2 Cell 3 Cell 4 BGA

54 Examples of tables (4) Spanning multiple columns using colspan Cell 1 and Cell 2 Cell 3 Cell 4 BGA

55 Examples of tables (5) Spanning multiple rows using rowspan Cell 1 and Cell 3 Cell 2 Cell 4 BGA

56 Examples of tables (6) The directory html/examples/tables/ contains several examples. examples/tables/examples.html BGA

57 Forms Forms provide interactive input on a web page JavaScript can process a form on the client- side Forms can be submitted to a program that runs on the server and processes the information entered in the form (e.g. a Perl or PHP script). BGA

58 The form tag Structure of a form that uses get <form action="..." method="get" target="..."> define form components here Structure of a form that uses post <form action="..." method="post" target="..."> define form components here BGA

59 Form components (1) creates a button that can be used to trigger functions created with JavaScript. Data for this form element is never sent to the server creates a check box that will be checked by default if the checked attribute is specified. The value specifies whether the check-box is checked or not using "off" and "on" (default) BGA

60 Form components (2) can be used to upload a local file to the server using a browse button Associates hidden values with the form that are not visible to the user but are sent to the server when the form is submitted. BGA

61 Form components (3) replaces a submit button with an image Creates a text input field in which a password can be typed. The characters typed are not displayed. The password sent to the server is not encrpyted. Creates a reset button that can be used to clear a form to its default values. BGA

62 Form components (4) creates a radio button that can be turned on or off. In a group only one button can be on. Data from the on button is submitted Creates a button used to submit the form data to the server for processing. BGA

63 Form components (5) creates a text input box of a given size for a maximum number of characters.... Defines multiple choice menu or scrolling list. Each element in the list is specified by tag... defines an option for a select list BGA

64 Form components (6) default text goes here creates a multi-line text input area with a specified number of rows and columns. BGA

65 Text field example (1) Please enter your first and last names First name: <input type="text" size="20" name="firstName"> Last name: <input type="text" size="20" name="lastName"> BGA

66 Text field example (2) examples/forms/form1.html BGA

67 List box example (1) Choose your province British Columbia Alberta Saskatchewan Manitoba Ontario BGA

68 List box example (2) Before choosing After choosing examples/forms/form2.html BGA

69 check box radio button (1) Which of the following types of wine do you like? <input type="checkbox" name="like" value="Shiraz" checked="checked">Shiraz Merlot Cabernet Sauvignon <input type="checkbox" name="like" value="Burgundy">Burgundy <input type="checkbox" name="like" value="Zinfindel">Zinfindel BGA

70 check box radio button (2) What is your favourite type of wine? <input type="radio" name="favourite" value="Shiraz" checked="checked">Shiraz <input type="radio" name="favourite" value="Merlot">Merlot <input type="radio" name="favourite" value="CabernetSauvignon">Cabernet Sauvignon <input type="radio" name="favourite" value="Burgundy">Burgundy <input type="radio" name="favourite" value="Zinfindel">Zinfindel BGA

71 Check box radio button (3) Note: Later we will process forms like this on server side with PHP) BGA examples/forms/form3.html

72 Frames Frames divide the browser window into several frames, each of which can display a different document. Frames are controversial and can be difficult to navigate. A common use is to have a non-scrolling area at the top of the browser window which could be used for a navigation bar or an advertising banner. BGA

73 Side by side frames <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN" " <frame src="right.html" name="right" scrolling="yes"> examples/frames/frameSet1.html BGA

75 A frame with links (1) <frame src="content.html" name="content" scrolling="yes"> BGA

77 The links page CNN Canoe JavaScript site examples/frames/frameSet2.html Note how the target refers to the name defined in the frame that should display the document BGA

78 Nested frame sets <frame src="top.html" name="top" scrolling="no"> <frame src="right.html" name="right" scrolling="yes"> <frame src="bottom.html" name="bottom" scrolling="no"> examples/frames/frameSet3.html BGA

80 Targeting frames The frame name can be referred to in a hypertext link... default page page to load when link is followed BGA

81 Online books (1) Frames are useful for displaying books online A left frame can hold the table of contents as links A right frame can display the content pages Alternatively the table of contents can be in a top frame and a bottom frame can be used to display the content pages. BGA

82 Online books (2) Chapter 11 of Intro to CS text book: side by side frames with style sheet top and bottom frames with style sheet without style sheet examples/javaChapter11/chapter11Frames1.html examples/javaChapter11/chapter11Frames2.html examples/javaChapter11/chapter11Frames3.html BGA

83 Online books (3) The side by side frameset The top and bottom frameset BGA

84 Online books (4) Each chapter can be in a separate html file. Anchors can be used to give names to specific parts of a document For example the following anchor can be places just before section 1 It can be referenced by a hypertext link in the same document using link text BGA

85 Online books (5) Anchor example from chapter11 1 Introduction... 2 The basic structure BGA

86 Online books (6) Then in the table of contents (toc.html) we would use <a href="chapter11.html#section1" target="page">1 Introduction <a href="chapter11.html#section2" target="page">2 The basic... BGA

87 Online books (7) It can be referenced in another document such as chapter7.html using the hypertext link link text examples/javaChapter11/example.html BGA