Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 HTML Standards & Compliance. 2 Minimum Required HTML tags: (must go in this order!)

Similar presentations

Presentation on theme: "1 HTML Standards & Compliance. 2 Minimum Required HTML tags: (must go in this order!)"— Presentation transcript:

1 1 HTML Standards & Compliance

2 2 Minimum Required HTML tags: (must go in this order!)

3 3 HTML document An HTML document can be created in any plain text editor like TextEdit on a Mac or Notepad on a PC and saved as anyname.html or anyname.htm.html file extension is preferred Most HTML tags have opening and closing tags Any extra lines or extra character spacing will be ignored

4 4 HTML tags Tags can be nested hello but must be nested in the correct order Tags were case insensitive (upper, lower or mixed) although the newer standards of XHTML now require all lower case (except in the DTD)

5 5 Additional required tags shown in bold required for validation: title goes here welcome to my webpage

6 6 Dreamweaver auto adds required code Authoring tools like Dreamweaver automatically put the required DTD and meta tag based on your preferences and HTML document version you specify when creating a new webpage

7 7 DTDs defined When authoring a document that is HTML or XHTML, it is important to Add a DTD or Doctype declaration The declaration must be exact (both in spelling and in case) to be understood DTD declaration is often called "Doctype” or “DTD” DTD example:

8 8 Why DTD is needed? Browsers, tools, and devices which process HTML documents, such as Web browsers, need to know which DTD an (X)HTML document is actually using This is a critical piece of information needed by browsers or other tools processing the document If you hand code your pages make sure to add the DTD

9 9 Other reasons to specify a doctype? Allows you to use tools such as a markup Validator to check the syntax of your (X)HTML (and hence discovers errors that may affect the way your page is rendered by various browsers) Such tools and browsers won't be able to work optimally if they do not know what kind of document or what version of HTML you are using

10 10 And even more reasons to specify a doctype? With most families of browsers, a doctype declaration or DTD will make a lot of guessing unnecessary Will trigger a "standard" parsing mode, where the understanding (and, as a result, the display) of the document is not only faster, it is also consistent and free of any bad surprise that documents without doctype will create Very important for “new” and “future” devices like cell phones which will be displaying web pages

11 11 Next, are some of the list of recommended declarations that you can use in your Web documents Refer to the following URL for a list of valid DTD's

12 12 HTML 4.01HTML 4.01 - Strict, Transitional, Frameset:StrictTransitionalFrameset

13 13 XHTML 1.0XHTML 1.0 - Strict, Transitional, Frameset:StrictTransitionalFrameset

14 14 XHTML 1.1XHTML 1.1 - DTD:DTD

15 15 The most widely used DTD by professional Web designers is XHTML 1.0 Transitional We will be using this version of XHTML during our class When you create a new document in DW File>New make sure you specify the DocType: XHTML 1.0 Transitional

16 16 The term “Transitional” in relation to DTD versions Means you are allowed to use some of the legacy HTML May be hard to know what tags are considered legacy vs obsolete Should always validate your page to test for compliance

17 17 Some argue the most widely supported DTD is 4.01 4.01 is no longer recommended for authoring since it is an old versions of HTML and represents outdated html and pre CSS

18 18 HTML Deprecated vs Obsolete Deprecated means outdated and may soon become obsolete Obsolete means it is no longer supported and may not be recognized (by browsers or interpreters)

19 19 Deprecated A deprecated element or attribute is one that has been outdated by newer constructs Deprecated elements may become obsolete in future versions of HTML User agents (like browsers) should continue to support deprecated elements for reasons of backward compatibility

20 20 Obsolete An obsolete element or attribute is one for which there is no guarantee of support by a user agent Obsolete elements are no longer defined in the specification

21 21 DEPRECATED example The following HTML page illustrates the use of the deprecated attributes, deprecated in XHTML It sets the background color of the canvas to white, the text foreground color to black, etc. A study of population dynamics ... document body...

22 22 CSS Cascading Style Sheets In XHTML the presentational attributes of BODY have been deprecated and replaced with CSS CSS now the preferred way to specify a document's presentation body { background-color: black; }

23 23 Older Browsers that don't support CSS Older browsers, before Netscape 4.0 and Internet Explorer 4.0, either don't support CSS at all or do so inconsistently For these browsers you can still control the style by using HTML if absolutely necessary

24 24 Validating HTML pages Webpage's can and should be valididated (tested) To further promote the reliability and fidelity of communications on the Web, W3C has a W3C Markup Validation ServiceW3C Markup Validation Service at Dreamweaver also allows you to validate from within its program File>Validate>Markup

25 25 Benefits to validating Web pages will work more consistently and on a wider variety of browsers Web pages load faster Will be better supported on new devices being used to view web pages More accessible to the visually impaired who use aural screen readers ( alt and src required for strict)

26 26 XHTML requirements Stricter standards than older HTML Legacy HTML has been removed To become validated you must have a fully compliant, standardized Web site Should always validate your page to test for compliance

27 27 XHTML requirements Start each page with DOCTYPE The open should come after the DOCTYPE Include both and elements Always include a element within element

28 28 XHTML requirements,, and elements must all be within the element Only put elements inside the element All inline elements and text need to be inside another block element before they can go in the element Only put text and other inline elements within an inline element, no block elements

29 29 XHTML requirements Keep block elements out of your element Requires inline elements (like ) to be nested inside block elements (like ) Use paragraphs for inline elements and for text

30 30 Inline elements must go in block elements Inline elements include,, Block elements include,,,, etc Don’t put block elements inside other block elements or inside inline elements Example of a block element containing an inline element Image of people waiting for food

31 31 XHTML requirements The blockquote element requires one or more block elements inside it You can put inline elements and text within a blockquote element but there must be another block element within it Text goes here But not the block element

32 32 XHTML requirements Empty tags (single tags) must be closed using / Image Line Break -end

Download ppt "1 HTML Standards & Compliance. 2 Minimum Required HTML tags: (must go in this order!)"

Similar presentations

Ads by Google