Conversion to Web Standards

Tips, Tricks, and Methods

Daniel M. Frommelt

University of Wisconsin - Platteville

"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 work with "Standards".

Web Standards: Benefits?

Major benefits:

  • First Step toward Accessibility
  • Forward / Backward compatible with User Agents
  • Bandwidth savings
  • Easier transitions for future updates
  • Printer Friendly
  • First step toward Search Engine Optimization

Yes. Web Standards

This presentation is a continuation on previous Web Standards work.

If you are not familiar with Web Standards, let me point you to a presentation hosted by Web Accessibility for All.

OR

You can visit previous presentation documentation and the Campus Web Council of Wisconsin Reference Links.

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!

Base CSS Concepts

There are two concepts that are fundamental for all re-designs.

  • IR - Image Replacement
  • LI - List Items

There are numerous CSS concepts that one should be concerned with, however the majority of all transitions rely on these two concepts.

Image Replacement


HighEdWebDev05
<h1><span>HighEdWebDev05</span></h1>
h1 span {margin-left: -999em;} h1 { background: transparent url(images/logo.gif) no-repeat; height: 106px;}

IR Example file

The benefits of IR is that screen readers (and search engines) can read the content of the page, while still rendering the appropriate display as the design dictates.

List Items

List Items are not just for ordered and unordered lists. Anytime you have two or more of something on a page, put it in a list. They are very flexible as we will see in the re-design.

UW-Milwaukee Structure

  • Four basic elements to UW Milwaukee's webpage:
    • Header
    • Menu
    • Body
    • Footer

To begin this project, we looked at the current UW Milwaukee website to see how the page was laid out, to determine the div structure.

Milwaukee, like most websites, has a clear header, menu, body and footer. We laid out these four basic divs, and a wrapper div to enclose everything, and started working.

Header

Two elements to the header: The title and quicklinks

The header has two elements: The title and quicklinks. The title was easy, just an image wrapped in an anchor tag pointing toward UW Milwaukee. I gave the header a height of 72px and a black bottom border of 8px to mimic the current header on UW-Milwaukee

Header

Quicklinks

  • IR Technique - "Quick Links"
  • LI Technique - two rows of link lists

The quicklinks has two elements, the title "quicklinks" and then the links themselves. For the title, I used the fir technique to replace an h3 with the quicklinks image that's currently on the UW Milwaukee page.

I organized the links in two unordered lists, a top row and a bottom row. Styling the lists, I lined them up and gave them a border left of 1px, so they would be separated like on the current page.

Search

  • Repeated background image:
  • Styled input tags
  • Slanted left border, a styled label tag containing this image:

The next element down the page was the search field. the way that it was set up on the current website, there was a slant on the left side, as well as a bottom black border of 2px. This was hard to replicate, because of the nature of DIV's, If I had done a black bottom border, it would have run past the slanted left border, so I had to do two images, and fake a border.

Title

  • IR Technique
  • Positioned to line up with the search bar on the right and the side bar on the left

To mimic the title on the UWM webpage, I used the fir technique on an H1, and positioned the h1 to line up to the top and connect with the search bar

Sidebar

  • Linked image for the athletics logo
  • Styled unordered list with a custom bullet image
  • Repeated image to create a faux column

I used the technique described on A List Apart to create the faux column down the left side, and in it, made a styled unordered list and an image linking to the athletics department.

Bottom

A div was placed at the bottom of the content containing the image above to re-create the bottom of UWM's current webpage

Footer

The footer information was placed inside an address tag, which was floated left, and a span, which was floated right.

End Result

Final re-design of UW-M's site

The end result is a new CSS design, that will stretch correctly while maintaining the look and feel of the original design.

CSS Ninja attacks UWM


Code Walk-through

Now is the time we look under the hood of the re-design and see what was accomplished.

CSS Ninja

CSS Ninja Attack


Questions?

CSS Ninja

Conversion to Web Standards

Tips, Tricks, and Methods

Daniel M. Frommelt

University of Wisconsin - Platteville

Presentation materials are all online at: http://www.uwplatt.edu/web/webstandards

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.