1 XHTML محمد احمدی نیا
2 Of 19 HTML vs XHTML XHTML is a stricter and cleaner version of HTML. by combining the strengths of HTML and XML, XHTML was developed XHTML is HTML 4.01 redesigned as XML. correctly and "well-formed“ زبانهای برنامه سازی وب
3 Of 19 What Is XHTML? XHTML stands for EXtensible HyperText Markup Language XHTML is almost identical to HTML 4.01 XHTML is a stricter and cleaner version of HTML XHTML is HTML defined as an XML application XHTML is a W3C Recommendation of January XHTML is supported by all major browsers. زبانهای برنامه سازی وب
4 Of 19 Why XHTML? Many pages on the internet contain "bad" HTML. This is bad HTML Bad HTML This is a paragraph market consists of different browser technologies run on computers, mobile phones or other small devices. Smaller devices often lack the resources or power to interpret a "bad“ code زبانهای برنامه سازی وب
5 Of 19 Differences from HTML XHTML elements must be properly nested XHTML elements must always be closed XHTML elements must be in lowercase XHTML documents must have one root element زبانهای برنامه سازی وب
6 Of 19 XHTML Syntax XHTML Elements Must Be Properly Nested In XHTML, all elements must be properly nested within each other, like this: This text is bold and italic زبانهای برنامه سازی وب
7 Of 19 XHTML Syntax Non-empty elements must have a closing tag. This is wrong: This is a paragraph This is another paragraph This is correct: This is a paragraph This is another paragraph Empty Elements Must Also Be Closed A break: A horizontal rule: An image: زبانهای برنامه سازی وب
8 Of 19 XHTML Syntax XHTML Elements Must Be In Lower Case Tag names and attributes must be in lower case. This is wrong: This is a paragraph This is correct: This is a paragraph زبانهای برنامه سازی وب
9 Of 19 XHTML Syntax XHTML Documents Must Have One Root Element XHTML elements must be nested within the root element Child elements must be in pairs and correctly nested زبانهای برنامه سازی وب
10 Of 19 XHTML Syntax Attribute Values Must Be Quoted This is wrong: This is correct: زبانهای برنامه سازی وب
11 Of 19 XHTML Syntax Attribute Minimization Is Forbidden This is wrong: This is correct: زبانهای برنامه سازی وب
12 Of 19 XHTML Syntax Mandatory XHTML Elements An XHTML document must have a DOCTYPE declaration. The html, head, title, and body elements must also be present. زبانهای برنامه سازی وب
13 Of 19 XHTML Doctypes refers to a Document Type Definition (DTD). A DTD specifies the rules for the markup language, so that the browsers render the content correctly. The basic document structure is: زبانهای برنامه سازی وب
14 Of 19 An XHTML Example Title of document xmlns attribute in, specifies the xml namespace for a document, and is required زبانهای برنامه سازی وب
15 Of 19 XHTML Different Doctypes XHTML 1.0 Strict contains all HTML elements and attributes does NOT INCLUDE presentational or deprecated elements (like font). Framesets are not allowed. The markup must also be written as well-formed XML. زبانهای برنامه سازی وب
16 Of 19 XHTML Different Doctypes XHTML 1.0 Transitional contains all HTML elements and attributes INCLUDING presentational and deprecated elements (like font) Framesets are not allowed The markup must also be written as well-formed XML زبانهای برنامه سازی وب
17 Of 19 XHTML Different Doctypes XHTML 1.0 Frameset This DTD is equal to XHTML 1.0 Transitional, but allows the use of frameset content. زبانهای برنامه سازی وب
18 Of 19 XHTML HowTo 1. Add a Add an XHTML to the first line of every page: 2. Add an xmlns Attribute Add an xmlns attribute to the html element of every page: 3. Change Tags And Attribute Names to Lowercase زبانهای برنامه سازی وب
19 Of 19 XHTML HowTo 4. Quote All Attribute Values Check every page to see that attribute values are quoted. 5. Close all Empty Tags 6. Validate XHTML With The W3C Validator using this url: زبانهای برنامه سازی وب