XHTML Week Two Web Design. 2 What is XHTML? XHTML is the current standard for HTML Newest generation of HTML (post-HTML 4) but has many new features which.

Slides:



Advertisements
Similar presentations
CSCI N241: Fundamentals of Web Design Copyright ©2004 Department of Computer & Information Science Introducing XHTML: Module B: HTML to XHTML.
Advertisements

Copyright © 2003 Pearson Education, Inc. Slide 3-1 Created by Cheryl M. Hughes The Web Wizards Guide to XML by Cheryl M. Hughes.
Basic HTML Workshop LIS Web Team Spring 2007.
Dr. Alexandra I. Cristea XHTML.
Internet Services and Web Authoring (CSET 226) Lecture # 5 HyperText Markup Language (HTML) 1.
3/10/11 Lecture 2. W3C - 2 The World Wide Web consortium was created in October 1994 to lead the World Wide Web to its full potential by developing common.
1 HTML Standards & Compliance. 2 Minimum Required HTML tags: (must go in this order!)
XHTML Basics.
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.
Pengantar Teknologi Mobile 13 Antonius Rachmat C, S.Kom, M.Cs XHTML.
History Leading to XHTML
XHTML 16-Apr-17.
HTML and XHTML Controlling the Display Of Web Content.
XHTML1 Building Document Structure. XHTML2 Objectives In this chapter, you will: Learn how to create Extensible Hypertext Markup Language (XHTML) documents.
XHTML and CSS Overview. Hypertext Markup Language A set of markup tags and associated syntax rules Unlike a programming language, you cannot describe.
17-Jun-15 XHTML 2 What is XHTML? XHTML stands for Extensible Hypertext Markup Language XHTML is aimed to replace HTML.
Creating a Well-Formed Valid Document. 2 Objectives Introducing XHTML Creating a Well-Formed Document Creating a Valid Document Creating an XHTML Document.
XHTML and CSS Overview. Hypertext Markup Language A set of markup tags and associated syntax rules Unlike a programming language, you cannot describe.
Upgrading to XHTML DECO 3001 Tutorial 1 – Part 1 Presented by Ji Soo Yoon 19 February 2004 Slides adopted from
Introducing XHTML: Module B: HTML to XHTML. Goals Understand how XHTML evolved as a language for Web delivery Understand the importance of DTDs Understand.
© Ms. Masihi 1.  A web page is created using a language called, Hypertext Markup Language, better known as HTML Code.  HTML is a user friendly language.
Introducing HTML & XHTML:. Goals  Understand hyperlinking  Understand how tags are formed and used.  Understand HTML as a markup language  Understand.
Computer Sciences Department
Working with XHTML Creating a Well-Formed Valid Document.
XP Tutorial 9New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
_ HTML, XHTML & CSS Sami Niemelä | Module 1: Introduction to digital media: Day 02.
Week 1.  Phillip Chee   Ext.1214 
 XHTML is aimed to replace HTML  XHTML is almost identical to HTML 4.01  XHTML is a stricter and cleaner version of HTML  XHTML is HTML defined as.
CS 299 – Web Programming and Design Introduction to HTML.
HTML (HyperText Markup Language)
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.
XHTML - Basics Teppo Räisänen LIIKE/OAMK Introduction XHTML = eXtensible Hypertext Markup Language Transitional ~ HTML 4.01 Goal: to replace HTML.
CS134 Web Design & Development Creating a Basic Web Page Mehmud Abliz.
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.
XHTML1 Building Document Structure Chapter 2. XHTML2 Objectives In this chapter, you will: Learn how to create Extensible Hypertext Markup Language (XHTML)
CS134 Web Design & Development Creating a Basic Web Page Exerted from Mehmud Abliz slides.
3 XHTML.
1 HTML XHTML. 2 Understand the Doctype tag Know the html tags which are now classed as depreciated Understand how Dreamweaver adds styles Add styles to.
1 XHTML محمد احمدی نیا 2 Of 19 HTML vs XHTML  XHTML is a stricter and cleaner version of HTML.  by combining the strengths of HTML.
XHTML. Introduction to XHTML What Is XHTML? – XHTML stands for EXtensible HyperText Markup Language – XHTML is almost identical to HTML 4.01 – XHTML is.
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.
XP 2 HTML Tutorial 1: Developing a Basic Web Page.
HTML: Hyptertext Markup Language Doman’s Sections.
Lesson 4.
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.
XHTML By Trevor Adams. Topics Covered XHTML eXtensible HyperText Mark-up Language The beginning – HTML Web Standards Concept and syntax Elements (tags)
1 Web Application Programming Presented by: Mehwish Shafiq.
Lecture: Web Design Assis. Prof. Freshta Hanif Ehsan Faculty of Computer Science Kabul Polytechnic University Spring Semester
HTML Basics Computers. What is an HTML file? *HTML is a format that tells a computer how to display a web page. The documents themselves are plain text.
Objective: To describe the evolution of the Internet and the Web. Explain the need for web standards. Describe universal design. Identify benefits of accessible.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
XP 2 HTML Tutorial 1: Developing a Basic Web Page.
Creating Your 1 st Web Page. Tags Refers to anything between on a webpage Most appear in pairs surrounding content Some appear as empty tags (no closing.
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.
What is XHTML? XHTML stands for Extensible Hypertext Markup Language
Creating a Well-Formed Valid Document
Elements of HTML Web Design – Sec 3-2
HTML: HyperText Markup Language
Elements of HTML Web Design – Sec 3-2
Coding, Testing and Valdating a Web Page
What is XHTML?.
Elements of HTML Web Design – Sec 3-2
XHTML
Web Programming Maymester 2004
XHTML 7-May-19.
Lesson 2: HTML5 Coding.
XHTML 29-May-19.
محمد احمدی نیا XHTML محمد احمدی نیا
Presentation transcript:

XHTML Week Two Web Design

2 What is XHTML? XHTML is the current standard for HTML Newest generation of HTML (post-HTML 4) but has many new features which mean that it is, in some ways, like XML XHTML stands for eXtensible HyperText Markup language and is a cross between HTML and XML

3 Why Use XHTML? XHTML was created for two reasons:  To create a stricter standard for marking web pages, reducing incompatibilities between browsers  To create a standard that can be used on a variety of different devices without change

4 Standards XHTML is a web standard agreed by the W3C  Creates better structured code  Greater accessibility now and in the future  XHTML replaces HTML

5 The Main Differences Several main changes in XHTML from HTML v.4.0: All documents must have a Doctype All tags must be in lower case All tags must be nested correctly All tags must be closed All attributes must be quoted Rules about block & inline elements are stricter Attributes cannot be shortened The name attribute has changed

6 The Doctype The first change which will appear on your page is the Doctype  When using HTML it was good practice to add a Doctype to the beginning of the page  Although optional in HTML, XHTML requires you to add a Doctype

7 DTD – Document Type Definition The DTD defines how the XML (XHTML) document should be structured – the rules the document will adhere to. The main definition building blocks are:  Elements  Attributes (and the values they may have)  Entities

8 Doctypes There are three document type definitions available for use:  Strict  Transitional  Frameset The Doctype should be the very first line of your document and should be the only thing on that line You don't need to worry about it confusing older browsers because the Doctype is actually a comment tag It is used to find out which code the page is written in (but only by browsers/validators which support it)

9 Strict Used mainly when the markup is very clean and there is no 'extra' markup to aid the presentation of the document Best applied if you are using Cascading Style Sheets for presentation

10 Transitional Used if you want to use presentational features of HTML in your page

11 Frameset Used if you want to use frames on your page

12 HTML Document Format Page Title OTHER HEAD DATA DISPLAYED CONTENT

13 Lowercase Probably the biggest change in XHTML (besides the tags themselves) is that the way in which you write them must be correct In XHTML, tags must always be lower case This means that: are all incorrect tags and must not be used The code tag must now be used as follows:

14 Nesting Often need to apply several tags to a single element (e.g. text string)‏ Must open and close tags in the paired correct order (nesting)‏ For example, for bold red text in a paragraph, the correct nesting would be any of the following: Your Text What you must not do, is to close tags in the wrong order i.e. Your Text Although code in this form may be rendered using HTML, this is incorrect in the XHTML specification and would not be displayed correctly

15 Closing Tags All tags in XHTML must be closed Container tags are closed after the content they contain, e.g. if (whatever), important ) However, there are several which are standalone, non-container tags which do not get closed with a separate closing tag. The main three are:

16 Closing Tags 2 These non-container tags are closed within the actual tag itself:  Notice the space before the />  Not actually necessary in the XHTML specification (you could use ) but as well as being correct XHTML, it will also make the tag compatible with past browsers An example:

17 Attributes in quotation marks All attributes in XHTML must be quoted In HTML you could have used the following:  Gives no compatibility issues and would render okay  However, this is incorrect in XHTML coding All attributes must be surrounded by quotes (")‏ Therefore, the correct format of this code would be:

Block & Inline elements Some html elements always appear in their own ‘block’, that is, on their own set of lines:  p, table, div, ol, ul, dl, h1…h6 These are called block elements Some elements don’t go on a new line, they’re called inline elements:  img, strong, span, em

Block & Inline rules All inline elements must be in a block element  So, you can’t just have some text, or an image or any inline element unless it’s in a block – like a for instance  Inline elements can’t contain block elements Not all blocks can contain other blocks  You can’t put one block element inside another, except: a list item (li) can contain paragraphs td can contain paragraphs (p) and lists (ol, ul, dl) divs can contain anything, including other divs

20 Shortening Attributes Common practice in HTML to shorten some attributes Can’t be done with XHTML since it causes incompatibilities between browsers e.g. In XHTML, all shortened attributes must be given in their 'long' format e.g.

21 Show Me Some ID Another significant change using XHTML involves tag attributes In HTML, the tag can have an attribute called ‘name’, in XHTML you now use 'id' – which must be unique e.g. in HTML: e.g. in XHTML: In XHTML the name attribute can now only be used with certain elements and no longer with <img… nor <a…

22 Validation Can use W3C service to validate your Web pages against the HTML and XHTML recommendations  Go to  Enter your URL/file location in the text box Can upload files from hard drive The validation tool checks the syntax of the document and ensures it is well formed

Coding Tips Coding Clarity  Indentation  Comments Entities (special characters)

Indentation Indent your html structures for clarity, which is clearer? item one item two item one item two

25 Comments Good practice to include comments Provide indication of what each aspect of your code does/contains Enables easy access/modification for other developers Remember to comment your XHTML!

26 Special Characters - entities Certain characters are reserved for special use in XHTML e.g. < To be able to include these in a web page you need the formula &code;  i.e. for the ‘less than’ symbol (i.e. <), substitute the code <  Others examples are & for ampersand, © for copyright and £ for ??

27 Summary XHTML has superseded HTML  DOCTYPE definitions – Frames, Strict and Transitional  XHTML only accepts lowercase tags and attribute names  All attribute values must be quoted and no shortening is allowed  All tags must be ended correctly Web pages MUST be well formed  Check all syntax is correct  Validate!

28 Further Reading XHTML The Extensible HyperText Markup Language (Second Edition)‏  XHTML Tutorial  XHTML.ORG  Introduction to XHTML, with eXamples  XHTML: The Clean Code Solution  XHTML Information and Resources  XHTML 1.1. Under discussion, the next version of XHTML involving modularization 