Understanding
Web Standards

Daniel M. Frommelt

University of Wisconsin - Platteville

Understanding Web Standards

Web Standards


Presentation and documentation are online @

http://www.uwplatt.edu/web/webstandards

All Web Standards Presentations that have been done by Daniel M. Frommelt are at this URL.

Understanding Web Standards: Overview

  • Concept of Web Standards
  • Concept of DIV "skeleton" structure
  • Concept of CSS "skins" markup
  • Reasons to make the switch
  • What non-web designers need to know

"Web Standards?"

W3C is in essence the Godfather of the web. They make the recommendations on technologies that make the web grow. In some ways they are a lot like the United Nations; they are a group of diverse partners who keep everyone's best interest at heart, but they can't force people to do things.

"So what are Web Standards?"

Web Recommendations Standards

W3C Recommendation
  • XHTML 1.0 or higher
  • CSS Level 1 & CSS Level 2
  • DOM Level 1 & DOM Level 2
  • ECMAScript 262 (current JavaScript)

http://www.webstandards.org/about/

The word 'Recommendation' is there because the W3C can not force people to follow their suggestions. Therefore, replace the word with "Standards".

"What the heck is XHTML?"

"The Extensible HyperText Markup Language (XHTML™) is a family of current and future document types and modules that reproduce, subset, and extend HTML, reformulated in XML. XHTML Family document types are all XML-based, and ultimately are designed to work in conjunction with XML-based user agents. XHTML is the successor of HTML, and a series of specifications has been developed for XHTML.


http://www.w3.org/MarkUp/

It's simply XML formatted HTML.

"How do I convert to XHTML?"

  • Declare the DOCTYPE
  • Tag and attributes in lower case
  • Attributes must have quoted values
  • All tags must have an end tag (<br />)
  • Nest tags correctly
  • Validate the page (http://validator.w3.org)

"Any Benefits to XHTML?"

  • More Accessible
  • Eliminates silly mistakes in code
  • Renders more accurately in browsers
  • Backward AND forward compatible
  • First step toward Web Standards

Using XHTML is the first step toward success with Web Standards. Do this first, and worry about the rest of the stuff later. It does not solve accessibility issues, but it's a great first step.

XHTML is the Future

  • XHTML 1.0 Transitional
  • XHTML 1.0 Strict
  • XHTML 1.1
  • XHTML 2.0 (W3C Working Draft)

No more development of HTML!

W3C has merged the HTML working group into the XHTML working group. There will be no more development of HTML. On a similar note, the SGML working group has been merged with the XML working group. All future recommendations by the W3C will be some form of XML.

DIV "skeleton" structure

Table Design

  • Tables can build a nice layout
  • Tables are predictable

However,

  • Tables bloat the code
  • Can we eliminate tables?

Table Purpose

"Tables should not be used purely as a means to layout document content as this may present problems when rendering to non-visual media. Additionally, when used with graphics, these tables may force users to scroll horizontally to view a table designed on a system with a larger display. To minimize these problems, authors should use style sheets to control layout rather than tables."

http://www.w3.org/TR/html4/struct/tables.html#h-11.1

Alternative Design Method

  • DIVs can be an alternate to <table>
  • DIVs are a container like a table cell
  • CSS can position the DIV

<div id="article">xxx</div>

#article{ width:250px;
padding:5px; float:right;}

The DIV is in the XHTML and the #article is in the CSS.

DIV Design

Use DIVs to create the skeleton of the page.

  • There should be no display-specific information in the XHTML
  • The Goal: separate the information from the layout / presentation of the page
  • Layout is entirely controlled by CSS

DIV Design: Building Blocks

Identify major sections of the page

Legos (TM)
  • Masthead (Logo and Title)
  • Menu
  • Content
  • Search
  • Footer

Don't overuse the DIVs!
Don't worry about positioning in the XHTML!

The concept is a lot like Legos (TM). Just snap together the blocks of information you want, and then apply the design (CSS) later on.

DIV Sample Code

DIV Sample Code

DIV Structure?

  • Learning curve of DIV
  • Future of browsers is uncertain
  • WYSIWYG Editors

WYSIWYG Problems

MS Word Example

WYSIWYG editors have major problems with Web Standards. Currently there are none that support ALL of the Web Standards.

Skinning Concept

Cell Phones
  • The skin is the design placed over the skeleton structure
  • It's like a cell phone
    • Model of phone is the skeleton
    • Face plates are the skins
    • You can swap face plates

Skinning Concept

  • Like a cell phone, web pages can have "face plates" (skins) that are changeable
  • The CSS skins have nothing to do with the XHTML markup
    Cell Phone
  • External CSS file
  • Easily modifiable
  • Faster Redesign

Overview of New Structure

  • XHTML DIVs are like the parts of the phone (antenna, buttons, speaker, etc.)
  • Layout CSS is like the different models of phones (where parts are positioned)
  • Skin CSS is like the face plates

CSS Zen Garden

The best example showing the power of CSS skinning!


http://www.csszengarden.com


Web Standards don't have to be ugly!

CSS Zen Garden: Example

CSS Zen Garden Example

CSS Zen Garden: Example

CSS Zen Garden Example

CSS Zen Garden: Example

CSS Zen Garden Example

CSS Zen Garden: Example

CSS Zen Garden Example

CSS Zen Garden: Example

CSS Zen Garden Example

"How do I build this?"

Style sheets for a skinnable website:

  1. Base CSS - simple structure
  2. Advanced CSS - final structure @import
  3. Skin CSS - design/presentation @import
  4. Fonts CSS
  5. Printer Friendly CSS

"Why so many CSS files?"

  • Setting the stage for forward AND backward compatibility
  • @import - fix non-standard browsers
  • Layout CSS separate from Skin
  • Fonts can now be adjusted quickly
  • Printer Friendly without the hassle!

It's just too cool!

Slashdot: Orignial Print Option

Slashdot's Oringal Print Option

Slashdot: CSS Print Option

Slashdot's CSS Print Option

Emphasis on Information

In 1995, Al Gore coined the phrase:

Al Gore

"Information Superhighway"
NOT
"Design Superhighway"


http://www.nortropic.com/lis341/cgold/superway.html

Emphasis on Information

  • Web is about delivering information
  • Design must be secondary
  • You cannot control what user agent will open the page, so you must be ready
  • Backward and forward compatibility is essential

Backward Compatibility

  • Compliant with older browser without having to make a separate set of pages
  • Design fails gracefully - It's not pretty, but the information is there!

Slashdot in an old Browser

Slashdot in a non Web Standards Browser

Forward Compatibility

  • More compliant user agents get better designed / presented information
  • Not committed to one platform / browser
  • Ready for what the future brings
    • PDA
    • Cell phone
    • TV
    • Screenreaders

Slashdot in a Web Standards Browser

Slashdot in a Web Standards Browser

Slashdot in Alternative Devices

Slashdot in a PDA Slashdot in a OpenWave Cellphone Browser

Bandwidth Savings

Using web standards saves on bandwidth

  • Code reduction with limited markup provides cleaner and simpler code
  • CSS files are cached

Slashdot Example

Slashdot is a well known site:

  • Copied the index on July 22, 2003
  • HTML 3.2 code
  • Table driven design

Slashdot Example Stages

There are four stages (folders):

  • Original file as of July 22, 2003
  • XHTML with no markup
  • Re-structured XHTML - identify data
  • Web Standards Version

Additional information and example zip file is online at: http://www.uwplatt.edu/web/webstandards/slashdot.html

Slashdot in a Web Standards Browser

Slashdot in a Web Standards Browser

Slashdot Bandwidth Savings

Actual savings per page:

  • Without caching CSS: ~2KB
  • With caching CSS: ~9KB

That's not a lot, however it adds up!

Slashdot Bandwidth Savings

Slashdot serves 80 million pages a month, which is ~31 pages per second.

(http://slashdot.org/faq/slashmeta.shtml#sm300)

Savings per day:

  • Without caching CSS: ~5.1 GB
  • With caching CSS: ~22.8 GB

Last Modified: 7/12/04

Personal Bandwidth Story

  • Over two years ago... we made the leap.
  • Saved a few KB, and thought "big deal."
  • Network team PANICKED because of unexpected drop in server load.
  • Everyone is much happier / wiser now!

Epic Systems Example

Web Development student rebuilt Epic Systems

  • Redesigning just the front page of Epic would
    • Reduce bandwidth by 3.16 GB per month
    • Cash savings of $758.40 yearly (main page only)
  • Projected savings for re-building all of Epic:
    $38,400 per year
  • The site is now Web Accessible, when it wasn't before!
  • Additional information is located at: http://www.vizjerai.com/redesign/index.html

The Epic Systems example is the work of Andrew Assarattanakul, web development student for UW-Platteville.

Diagnosis: UW - Milwaukee

Global Statistics

Total HTTP Requests:51
Total Size: (bytes)113,384

Object Size Totals

Object typeSize (bytes)
HTML:45,078
HTML Images:65,214
CSS Images:0
Total Images:65,214
CSS:3,092

Please remember that the University of Wisconsin - Milwaukee retains all copyright information on their content, images and design.

Result: UW - Milwaukee

Global Statistics

Total HTTP Requests:25
Total Size: (bytes)58,969

Object Size Totals

Object typeSize (bytes)
HTML:8,932
HTML Images:25,274
CSS Images:18,677
Total Images:43,951
CSS:6,086

The data was obtained after the page was re-designed, by using the "Speed Report" tool from Mozilla's Web Developers Toolbar extension.

Side-by-side comparison:

Global Statistics

BeforeAfterSavingsReduction
Total HTTP Requests:51252651%
Total Size: (bytes)113,38458,96954,41548%

Object Size Totals

Object typeBeforeAfterSavings
HTML:45,0788,93236,146
HTML Images:65,21425,27439,940
CSS Images:018,677-18,677
Total Images:65,21443,95121,263
CSS:3,0926,086-2,994

The end result is that there is about a 50% cut in bandwidth and server connection requests just for the index page alone. Imagine the bandwidth savings!

Diagnosis: WiLS

Global Statistics

Total HTTP Requests:25
Total Size: (bytes)75,188

Object Size Totals

Object typeSize (bytes)
HTML:11,718
HTML Images:2,062
CSS Images:61,408
Total Images:63,470
CSS:0

Please remember that WiLS retains all copyright information on their content, images and design.

Result: WiLS

Global Statistics

Total HTTP Requests:25
Total Size: (bytes)68,537

Object Size Totals

Object typeSize (bytes)
HTML:2,568
HTML Images:2,062
CSS Images:61,408
Total Images:63,470
CSS:2,499

The data was obtained after the page was re-designed, by using the "Speed Report" tool from Mozilla's Web Developers Toolbar extension.

Side-by-side comparison:

Global Statistics

BeforeAfterSavingsReduction
Total HTTP Requests:252500
Total Size: (bytes)75,18868,5376,6519%
Cached Size: (bytes)46,7182,56844,15094%

Object Size Totals

Object typeBeforeAfterSavings
HTML:11,7182,5689,150
Total Images:63,47063,4700
CSS:02,499-2,499

Web Standards: Advocacy

Non web designers can be Advocates

You may not touch code, but what about your decisions?

  • Vendor contracts & software purchases
  • Content management & database systems
  • Web sub-contractors
  • Staffing decisions

You don't need to know "How", but you need to know how to help your web staff.

How to inform other webmasters

In Conclusion

Web Standards is a journey

Not a quick fix, so don't expect it

Major benefits:

  • Forward / Backward compatible
  • Bandwidth savings
  • Easier transitions for future updates
  • Printer Friendly!

"Don't Panic"

Don't Panic

In the immortal words of Douglas Adams, "Don't Panic".

Personal Speaking Story

Sean Sieg, Jeffrey Zeldman, and Daniel Frommelt

Web Standards

Understanding Web Standards


Presentation and documentation are online @

http://www.uwplatt.edu/web/webstandards


Email: frommelt@uwplatt.edu

Copyright Information

Copyright Daniel M. Frommelt, 2005. This work is the intellectual property of the author. Permission is granted for this material to be shared for non-commercial, educational purposes, provided that this copyright statement appears on the reproduced materials and notice is given that the copying is by permission of the author. To disseminate otherwise or to republish requires written permission from the author.