Archive for the 'HTML' Category

CSS Sprites

Monday, May 21st, 2007

I am in a continual process of reevaluating and documenting web development techniques that I have learned in the past. In this vain, here is a trick that I used on the Weary Davis web site for the menu. I have included an image of the entire menu unfurled for all to see. The foundation of the technique is covered well by David Shea on A List Apart in a piece entitled “CSS Sprites: Image Slicing’s Kiss of Death.” I use this technique a lot. In fact, I am using a version of it on the Robert Eatman redesign.

The benefits of this technique are clean, semantic HTML, easier asset management (i.e. one image to maintain), and pure separation of presentation from content.

Weary Davis Menu Image Reduced

Sending HTML Email via Entourage

Friday, April 20th, 2007

The best way to send an HTML email through Entourage is via MS Word. Entourage’s HTML editing engine is very basic. It is impossible to make text a link, ie you can’t make Telos Studios a link to http://www.telosstudios.com. It will automatically make URLs in text links, which is not adequate.

After you’ve created your email message in Word, goto File > Send To > Mail Recipient (as HTML) … That should do it. This method will also allow you to send tables, images, and other more complex HTML.

Solutions for IE’s PNG Problems

Saturday, April 7th, 2007

All versions of Internet Explorer prior to 7 cannot correctly display the transparent PNG-24 images. In place of the transparent pixels are light gray pixels. The solution that I like the most is called the IE PNG Alpha Fix. It uses a .htc file that corrects the behavior of IE using javascript. The fix also requires the a CSS hook:

* { behavior: url(iepngfix.htc); }

I have used this solution on a couple of projects now, it works well and doesn’t require gratuitous HTML hackery.

sIFR

Saturday, March 3rd, 2007

Unobtrusive JavaScript, CSS, Flash typography  has been around for a while and is equally important as swfIR if not more so.

Separation of content from presentation

Tuesday, January 30th, 2007

Truth be told it is nearly impossible to separate content from presentation with HTML and CSS while making semantically lean markup. At least that is true if the design of the presentation is complex and unique. Designers tend to like flourishes, embellishments, and other eye candy. Treated right, this is a good thing. Our minds like high-quality, stylized content. But high-quality design will add structures in the the markup that aren’t related to the actual content. These structures or hooks, are great for adding design elements, but bad for long-term maintainability of a site.

Here is an example of a design hook that I used while making the Harris Construction web site.

<div id=“big”>  <div id=“little”>div>
<div id=“rightConcrete”>div>
<div id=“topLeft”>
<div id=“topRight”>
<div id=“bottomLeft”>
<div id=“bottomRight”>

In retrospect, I could have developed this code better by using non-design specific ids. That would have been in the mindset of future reusability. Not that the hooks that I used can’t be reusable, but non-specific hooks would have been better. CSS Zen Garden uses a similar approach by adding non-semantic, empty divs much like the ones I used above. The Garden also uses ubiquitous id and class attributes to accommodate nearly every design situation that can be thought of. While this is good for the Garden’s purpose, leaner code means saved bandwidth, more maintainability, and many other thing.
What is the solution to this conundrum? Content Management Systems.

The only true way to separate content from presentation is to rely on a content management system. With a CMS, the possibilities for redesigns, media neutral delivery, and everything in between are limitless. A well-designed, flexible content management system will allow many different views of the content. This means that you can have a couple of HTML views (one for the primary design, one for printing, one for handheld devices), a PDF view, an RSS feed, and much more. Content Management Systems enable website managers to flex their designs in a cost effective manner.

Content management systems do more than just help with separating content from separation. But that is saved for a later post.

On Web Accessibility

Sunday, January 21st, 2007

What is accessibility?

In the world of the web, accessibility means providing a broad audience the opportunity to “view” your web site, regardless of their disability. Accessible web sites are needed to accommodate people with disabilities such as no-to-low vision, color blindness, and limited mobility. These web sites can be used with assistive technology – screen readers, Braille tactile feedback devices, embossing printers, and TDD.

Who needs accessible web sites?

There are two main groups whose web sites should be accessible. The first is all state and federal agencies as they are required by law to accommodate those with special needs. The second is any organization or company that wants to reach a broader audience and wants the additional benefits of meeting web accessibility standards.

How is accessibility regulated?

The requirements for State of Kansas agencies are described in the Web Content Accessibility Guidelines for the State of Kansas Version 2.0. The federal requirements for all federal and state agencies are covered by Section 508 of the Rehabilitation Act. These guidelines are based on valid CSS2+ with either HTML4.0+ or XHTML 1.0+ code, which are collectively known as web standards. Both federal and state guidelines are very similar in their requirements and suggestions.

How to create an accessible web site?

There are two keys to creating and maintaining an accessible website. The first key is valid and appropriate use of web standards. Web pages should be tested for errors by the World Wide Web Consortium’s on-line validator, which identifies any incorrect use of web standards within the page.

Being able to validate a document’s semantic structure is only part of what is needed to create an accessible web site. The second key is to craft pages with accessibility in mind. Documents should be able to gracefully degrade to web browsers that do not have the ability to read the document in its intended format. For a video interview on your site, for example, a transcript of that interview should be available to a person who cannot hear. Additionally, pages should not rely on visual elements alone for tasks such as navigation, nor should they be worded in a confusing manner.

What are the benefits of web standards and accessibility?

Reduced Bandwidth

In general, a web page that uses web standards is 25-50% smaller in file size than a traditional web page because the page uses less markup and is separated from the look and feel of the site. The practical benefits of this are faster download time for your users and lower costs for your hosting service.

Easier Maintenance

The benefit of having smaller documents is also apparent in maintenance. Since most of the traditional HTML is replaced with web standard HTML, site developers and maintainers can concentrate on what is most important: the content of the page.

More Access

CSS2+ allows users to be able to access your site with more devices. One of the mainstays of CSS is the ability to apply a different style sheet to a document to change both its appearance and its user interface. Different style sheets can be used to enable a PDA, a voice reader, a Braille display, or other devices to access your site. High-contrast, large-print, and printable versions of your site can also be created.

Happier Federal Government

As noted earlier, the government requires that any federal agency must meet Section 508 guidelines of the Rehabilitation Act. For more information, visit www.section508.gov.

Better Search Engine Indexing

Search engines can use up to 100 different criteria for ranking your sites within their search results. Web standards allow you to place the content of your document near the top of the document source. This allows search engines to index the page’s content before processing the navigation and other repetitive elements. Some search engines scan only the top of web documents.

Terms Used in This Document

TDD (aka TTY)– Telecommunications Device for the Deaf. When a deaf customer calls, this device relays the through an operator. The operator then types what you say. That is then transmitted back to the caller’s TDD. The TDD then “displays” what you said. TDD devices are included in the CSS specification and can be used to enhance a sites accessibility.

HTML – HyperText Markup Language. HTML is the format the most web pages are coded in. The current version of HTML is 4.01.

XHMTL – Extensible HyperText Markup Language. XHTML is a reformation of HTML 4.0 into XML.

XML – Extensible Markup Language. XML is a flexible way to create standard information formats and share both the format and the data on the World Wide Web.

Markup – Markup is another term for the HTML that surrounds the real content of a web page. It describes to a browser how the document should be displayed.

Web Standards – Web standards are specifications on how to properly code your web pages. The pertinent web standard specifications for most web sites are HTML4.0+ or XHTML 1.0+ and CSS2+.

World Wide Web Consortium (W3C) – The W3C is a mostly volunteer group that develops open, well-defined specifications and guidelines for web development.

Cascading Style Sheet (aka CSS or style sheet) – CSS is the principle technology for controlling a site’s look and feel, including colors, fonts, and general layout.