Chapter 4 Introduction to XHTML: Part 1

Slides:



Advertisements
Similar presentations
INTRODUCTION TO HYPERTEXT MARKUP LANGUAGE 1. Outline  Introduction  Markup Languages  Editing HTML  Common Tags  Headers  Text Styling  Linking.
Advertisements

1 Outline 9.1Introduction 9.2Markup Languages 9.3Editing HTML 9.4Common Tags 9.5Headers 9.6Text Styling 9.7Linking 9.8Images 9.9Formatting Text With 9.10Special.
 2001 Deitel & Associates, Inc. All rights reserved. 1 Outline 9.1Introduction 9.2Markup Languages 9.3Editing HTML 9.4Common Tags 9.5Headers 9.6Text Styling.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 4 - Introduction to XHTML: Part 1 Outline 4.1 Introduction 4.2 Editing XHTML 4.3 First XHTML Example.
 2008 Pearson Education, Inc. All rights reserved. 1 Introduction to HTML.
 2004 Prentice Hall, Inc. All rights reserved. Introduction to XHTML: Part 1.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 4 - Introduction to XHTML: Part 1 Outline 4.1 Introduction 4.2 Editing XHTML 4.3 First XHTML Example.
Chapter 2 Introduction to HTML5 Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Chapter 2 HTML (Hypertext Markup Language) Part I.
Introduction to XHTML September 13, Components of website development
1 Outline 3.1 Introduction 3.2 Editing HTML 3.3 First HTML Example 3.4 W3C HTML Validation Service 3.5 Headers 3.6 Linking 3.7 Images 3.8 Special Characters.
4 HTML Basics Section 4.1 Format HTML tags Identify HTML guidelines Section 4.2 Organize Web site files and folder Use a text editor Use HTML tags and.
HTML (HyperText Markup Language)
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML Pt. 2.
Images (1) Three most popular formats – Graphics Interchange Format (GIF) – Joint Photographic Experts Group (JPEG) – Portable Network Graphics (PNG) –
 2002 Prentice Hall, Inc. All rights reserved.2 Chapter 2 — Introduction to HyperText Markup Language 4: Part I Outline 2.1Introduction 2.2Markup Languages.
XHTML1-1 Extensible HyperText Markup Language (XHTML) Xingquan (Hill) Zhu
Section 4.1 Format HTML tags Identify HTML guidelines Section 4.2 Organize Web site files and folder Use a text editor Use HTML tags and attributes Create.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
1 Introduction to HTML: Part 1 Outline Introduction Elements and Attributes Editing HTML Common Elements Headers Images Unordered Lists Nested and Ordered.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
INTRODUCTORY Tutorial 1 Using HTML Tags to Create Web Pages.
HTML: Hyptertext Markup Language Doman’s Sections.
Introduction to HTML Xiangming Mu 9/23/ Learning Objectives Understand basic HTML tags and their attributes Learn to create a simple HTML page.
Web Development & Design Foundations with XHTML Chapter 2 HTML/XHTML Basics.
1 Introduction to XHTML: Part 1 Outline Introduction Elements and Attributes Editing XHTML Common Elements W3C XHTML Validation Service Headers Linking.
WEB DESIGN AND PROGRAMMING Introduction to XHTML.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 2 Key Concepts 1 Copyright © Terry Felke-Morris.
4 HTML Basics Section 4.1 Format HTML tags Identify HTML guidelines Section 4.2 Organize Web site files and folder Use a text editor Use HTML tags and.
HTML Basics. HTML Coding HTML Hypertext markup language The code used to create web pages.
Introduction to XHTML 1 Chapter 4 Introduction to XHTML: Part 1 Reference From: Internet & World Wide Web: How to Program Deitel, Deitel & Goldburg.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Jozef Goetz contribution, J. Goetz, 2016  Pearson Education, Inc. All rights reserved.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Introduction to XHTML/HTML5 (part 1) Instructor: Sergey Goldman Based on Based on Internet & World Wide Web (multiple editions)
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 1 Using HTML to Create Web Pages.
Introduction to HTML5.
Introduction to HTML.
HTML Basics.
In this session, you will learn to:
Section 4.1 Section 4.2 Format HTML tags Identify HTML guidelines
Web Development & Design Foundations with HTML5 8th Edition
Chapter 24 – Introduction to XHTML Basic: Part I
Marking Up with XHTML Tags describe how a web page should look
4 Introduction to XHTML.
HTML: HyperText Markup Language
Creating a Home Page in HTML
3.00cs HTML Overview 3.00cs Develop webpages.
Chapter 4 Introduction to XHTML: Part 1
Chapter 1: Introduction to XHTML (part 1)
Chapter 5 Introduction to XHTML: Part 2
Introduction to XHTML.
Chapter 4 - Introduction to XHTML: Part 1
COMPUTING FUNDAMENTALS
HTML (HyperText Markup Language)
4 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
1 Introduction to XHTML.
Introduction to HTML- Basics
Introduction to XHTML Cont:.
Introduction to 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
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Marking Up with XHTML Tags describe how a web page should look
Presentation transcript:

Chapter 4 Introduction to XHTML: Part 1 Internet & World Wide Web: How to Program Deitel, Deitel & Goldburg Spring 2009 Yanjun Li CSRU2350

What is XHTML? EXtensible HyperText Markup Language XHTML 1.1 A markup language that specifies the format of the text that is displayed in a Web browser. Separation of the presentation of a document from the structure of the document’s information Based on HTML A legacy technology of the World Wide Web Consortium (W3C) Spring 2009 Yanjun Li CSRU2350

Editing XHTML XHTML documents Source-code form Text editor (e.g. Notepad, emacs, etc.) .html or .htm file-name extension Web server Stores XHTML documents Web browser Requests XHTML documents Spring 2009 Yanjun Li CSRU2350

First XHTML Example (1) <?xml version =“1.0”?> XHTML comments starts with <!-- and end with --> Mandatory XHTML Elements: <?xml version =“1.0”?> <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN” “http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”> <!–- this is an example page --> <html > <head> <title>Title goes here</title> </head> <body> </body> </html> Spring 2009 Yanjun Li CSRU2350

First XHTML Example (2) html element is the root element of a XHTML document head element Head section: Title of the document and Style sheets and scripts body element Body section: Page’s content the browser displays Spring 2009 Yanjun Li CSRU2350

First XHTML Example (3) Every element starts with Start tag and ends with End tag, with the displayed content in between them. Example: <html>. . .</html>, <head>. . .</head>. Start tag may have attributes (provide additional information about an element) A name and value pair Example: <html xmlns=“http://www.w3.org/1999/xhtml”> Spring 2009 Yanjun Li CSRU2350

XHTML Syntax Rules XHTML documents must have one root element XHTML elements be properly nested be closed be in lowercase Attribute names be in lower case Attribute values be quoted Spring 2009 Yanjun Li CSRU2350

main.html (1 of 1) Spring 2009 Yanjun Li CSRU2350

Headers Six headers ( header elements): h1 ~ h6 Spring 2009 Yanjun Li CSRU2350

Spring 2009 Yanjun Li CSRU2350

Linking Hyperlink References other sources such as XHTML documents and images Both text and images can act as hyperlinks Created using the a (anchor) element: <a> </a> Attribute href specifies the location of a linked resource : href = “http://www.yahoo.com” Link to e-mail addresses: href = “mailto:deitel@deitel.com” Spring 2009 Yanjun Li CSRU2350

links.html (1 of 2) Spring 2009 Yanjun Li CSRU2350

contact.html (1 of 1) Spring 2009 Yanjun Li CSRU2350

Malicious Link Manipulation ت Phishing: a link in an email leads to the spoofed website Make the anchor text for a link appear to be valid <a href=“http://www.badsite.com”> www.paypal.com </a> Misspelled URL <a href=“http://www.bananarepubli.com”>BR</a> الخداع: وصلة في رسالة بالبريد الالكتروني يؤدي إلى موقع المغشوش جعل يظهر النص مرساة لارتباط لتكون صالحة  <a href="http://www.badsite.com"> Spring 2009 Yanjun Li CSRU2350

Images (1) Three most popular formats Graphics Interchange Format (GIF) Joint Photographic Experts Group (JPEG) Portable Network Graphics (PNG) img element with attributes: src attribute : Specifies the location of the image file width and height attributes: Pixels (“picture elements”) alt attribute : the text will be displayed if the browser could not display the image. Spring 2009 Yanjun Li CSRU2350

Images (2) Empty elements Bold Terminated by character / inside the closing right angle bracket (>), or by explicitly including the end tag Example: <img src=“1.jpg” height=“238” width=“183” /> br element: Line break <br /> <strong> tag: <strong>Bold characters</strong> Bold Spring 2009 Yanjun Li CSRU2350

picture.html (1 of 1) Spring 2009 Yanjun Li CSRU2350

Spring 2009 Yanjun Li CSRU2350

Image as Link Use an image as a link Image has no border <a href=“http://www.yahoo.com”> <img src= "yahoo.gif" width="232" height = "44" /> </a> Image has no border <a href="FirstExample.html"> <img src="home.png" width="125" height="26" alt="Go Home" border="0" /> Spring 2009 Yanjun Li CSRU2350

nav.html (1 of 2) Spring 2009 Yanjun Li CSRU2350

Spring 2009 Yanjun Li CSRU2350

4.8 Special Characters and Horizontal Rules Some keyboards do not provide these symbols, or the presence of these symbols may cause syntax errors. Example: <p>if x < 10 then increment x by 1</p> XHTML provides character entity references (in the form &code;) for representing special characters. <p>if x < 10 then increment x by 1</p> &frac14 ¼ &lt < &gt > sup or sub element, to superscript text or subscript text Spring 2009 Yanjun Li CSRU2350

Internal Linking Enables the user to jump between locations in the same document First, create an internal hyperlink destination by setting attribute id of an element Second, create an internal link to this element. Example: <h1 id=“bugs”>Bugs </h1> : <a href=“#bugs”>Go to Bugs</a> Spring 2009 Yanjun Li CSRU2350

links.html (1 of 3) Spring 2009 Yanjun Li CSRU2350

links.html (3 of 3) Spring 2009 Yanjun Li CSRU2350

Creating and Using Image Maps (1) Designate certain areas of an image (called hotspots) as links Element map Attribute id identifies the image map Element img Attribute usemap refers the map by id. Example: <map id=“picOne”> .. </map> <img src=“picture.gif” usemap=“#picOne” /> Spring 2009 Yanjun Li CSRU2350

Creating and Using Image Maps (2) Element area defines hotspot Attribute shape and coords Specify the hotspot’s shape and coordinates Rectangular ( shape = “rect” ) Polygon ( shape = “poly” ) Circle ( shape = “circle” ) Attribute href Specifies the link’s target. Attribute alt Provides alternative text for the link. Spring 2009 Yanjun Li CSRU2350

picture.html (1 of 3) Spring 2009 Yanjun Li CSRU2350

picture.html (2 of 3) Spring 2009 Yanjun Li CSRU2350

Spring 2009 Yanjun Li CSRU2350

Unordered Lists Unordered list element ul Creates a list in which each item begins with a bullet symbol (called a disc) li (list item): Entry in an unordered list Format: <ul> <li> </li> </ul> Spring 2009 Yanjun Li CSRU2350

links2.html (1 of 2) Spring 2009 Yanjun Li CSRU2350

Spring 2009 Yanjun Li CSRU2350

Nested and Ordered Lists Represent hierarchical relationships Ordered lists (ol) Creates a list in which each item begins with a number Format <ol> <li> </li> </ol> Spring 2009 Yanjun Li CSRU2350

list.html (1 of 3) Spring 2009 Yanjun Li CSRU2350

list.html (2 of 3) Spring 2009 Yanjun Li CSRU2350

list.html (3 of 3) Spring 2009 Yanjun Li CSRU2350

Spring 2009 Yanjun Li CSRU2350

Type of Ordered List Attribute type defines the type of list Available types: type=“A” type=“a” type=“I” type=“i” type=“1” Spring 2009 Yanjun Li CSRU2350

Type of Unordered List Attribute type defines the type of list Available types: type=“disc” type=“square” type=“circle” Spring 2009 Yanjun Li CSRU2350

Special Characters and More Line Breaks Character entity references: &code; Numeric character references (e.g. &) See Appendix A, (page 1429) A complete list : http://www.w3.org/TR/xhtml-modularization/dtd_module_defs.html <del> </del> : Strike-out text <sup> </sup> : Superscript text <sub> </sub> : Subscript text <hr /> : Horizontal rule (horizontal line) Spring 2009 Yanjun Li CSRU2350

contact2.html (1 of 2) Spring 2009 Yanjun Li CSRU2350

contact2.html (2 of 2) Spring 2009 Yanjun Li CSRU2350

W3C XHTML Validation Service (1) Validation service ( validator.w3.org ) Checking a document’s syntax URL that specifies the location of the file Uploading a file to the site validator.w3.org/file-upload.html Spring 2009 Yanjun Li CSRU2350

W3C XHTML Validation Service (2) Spring 2009 Yanjun Li CSRU2350

Web Resources www.w3.org/TR/xhtml11 www.xhtml.org www.w3schools.com/xhtml/default.asp validator.w3.org hotwired.lycos.com/webmonkey/00/50/index2a.html wdvl.com/Authoring/Languages/XML/XHTML www.w3.org/TR/2001/REC-xhtml11-20010531 Spring 2009 Yanjun Li CSRU2350

Reference Reproduced from the PowerPoints for Internet & World Wide Web How to Program, 3e by Deitel, Deitel and Goldberg © 2004. Reproduced by permission of Pearson Education, Inc. Spring 2009 Yanjun Li CSRU2350