DiamondLime.com

 
 

Testing Multiple Versions of IE Simultaneously

When it comes to cross-browser compatibility, no browser causes more pain and suffering than Internet Explorer—no version is as standards-compliant as Firefox, Opera, or Safari, and every version has its own unique bugs and issues. The majority of CSS hacks, testing, and workarounds are for Internet Explorer. Testing has been a major pain, requiring a different computer or meddling with the registry for each version of IE.

Finally, Test IE7, IE6, IE5, IE4, and IE3 in Parallel

Yousif Al Saif built upon some others’ work to create an installation for each of the major versions of Internet Explorer since IE3. Read about it here, and download the multiple IE installer here.

Power Testing

The truth is, almost no one still uses IE 3 and IE 4, and very few people use IE 5. Most of your testing will involve IE 6 and IE 7, with an occasional nod to IE 5.5.

I installed IE 5.5, IE 6, and IE 7 on my machine. Everything is working fine, without any crashes, hanging, or strange behavior.

Testing is powerful and easy—I can open all the versions I want to test at the same time. I make a change and then hit Alt-Tab to switch through all the browsers on my machine—Firefox, Opera, and IE 5-7, thus covering about 95% of all the browser users out there and catching nearly all known (and still important) cross-browser issues.

I just need a Mac so I can test small changes on Safari (For final testing on a Mac (not incremental), see my post about testing on Safari).

 
 

Testing and Writing Locally

As a web developer and Internet marketer, I frequently have work that I’m doing that I want to preview and that I don’t want the public to see yet. How can you do testing and writing locally and still see what the public will see?

Install a Local Server

One of the best ways is to install a server that will run on your local machine. That way, you can use the same stylesheets, images, HTML, database schema, etc., that you use on your live site to preview your work without letting everyone see your mistakes before you can fix them.

XAMPP is Easy

Many, many web servers are LAMP servers—Linux, Apache, MySQL, and PHP. The only problem is, most of us use Windows on our machines for day-to-day use. Luckily, there are several solutions for running Apache, MySQL, and PHP on a Windows machine. My favorite is called XAMPP—it’s specifically designed to be easy to install and use.

In fact, beyond unpacking and clicking install, there is only one configuration option that I would recommend changing—block access to your server except from your machine. XAMPP installs a real server on your machine, and if you don’t turn off access, anyone looking for random servers could find it (think spyware, hackers, etc.). Luckily, configuring access to your server is easy.

I love XAMPP because I spend my time on my sites, not in tinkering with obscure Apache, PHP, or MySQL settings. If you need to test and write locally, consider XAMPP.

 
 

Web Design - Starting From Scratch

I recently had a fun experience—Michael Eagar and I sat down to talk about web design, coding, and templates. He asked me to show him some of the things I was talking about, and so we opened up a text editor and I started to write the code for a basic two column template from scratch. I didn’t refer to my normal templates or previous designs other than for a few hard-to-remember strings (like the text for my XHTML Doctype).

I had an amazing time and I produced amazing code.

By starting from scratch with my web design and doing my best to teach Michael some best practices, I was able to focus on the best way to do things, not just the way that everything was already done on my site and that would be a pain to change.

We cranked through the HTML and CSS, including personal instruction and most of the visual layout (sans-images) in less than two hours.

Visually Starting From Scratch

Avalonstar, SimpleBits, and others have recently toasted the CSS file for their sites and thrown all their presentation out. They did this as a kick in their own pants to get them moving and working on a new design that they will (hopefully) like better than the old one. Both Bryan and Dan talked about how liberating it was to start fresh on a new design for their site.

Mini-Paradigm Shifts

Coding from zero, or designing from a blank slate, isn’t always what’s necessary. In fact, be very, very careful not to discard all the things you’ve learned from your previous designs. However, being willing to question or let go of previous designs, methods, and ideas about web design can be liberating and trigger a mini paradigm shift—you may discover new ways of doing things that will increase your productivity and your designs’ effectiveness. So take a step back every once in a while and examine how things are done. If you really are doing things the best way, then you can be confident in the current system. If you aren’t, then you’ve found (and can begin to remedy) a potential problem or bottleneck.

 
 

The Myth of Separation of Content and Presentation

There is a somewhat recent movement in the web development world that is surrounded by quite a furor—the web standards movement. With the advent of browsers that do a half-way decent job of supporting CSS, many web developers claim that it is possible to build web sites that effectively separate presentation from content. This would allow you to write the HTML for your site once and update the appearance as much as you like without changing the code for the site.

Unfortunately, the separation of content and presentation is a myth.

For now.

The problem is that the capabilities of CSS are limited enough at the present moment that it is often hard to have enough “hooks” or HTML elements to apply CSS styles to, presenting web designers with a dilemma—either limit the range of achievable presentations or clutter page code with some non-semantic, presentational/layout HTML tags.

Web Design Heresy

There are many supporters of the web standards movement that would beg to differ and would call me a heretic. However, I am one of the strongest supporters of the web standards movement. I strive to separate my content and my presentation. I read about every method of overcoming browser deficiencies and inconsistencies that I can find. I wish that browser support for standards was better and that all designers would (eventually) throw away the use of tables for layout purposes. I would agree that separation of content and presentation has come a long, long way. I simply chose to present a controversial point of view in order to prove a point—there are times when it is impossible, or unreasonably difficult, to achieve certain presentations without more CSS “hooks.”

Extend the Power of CSS

Our pie-in-the-sky dream is that one day, hopefully sooner rather than later, CSS will have new abilities and powers added to it and supported in browsers that will make the separation of content and presentation and the creation of killer designs easier. Rounded corners. Equal-length columns. Minimum widths. No more hacks.

That day, however, may be a ways in the future. So what do we do in the meantime?

Those who fight the web standards movement usually claim that web standards supporters are over-idealistic and don’t focus on the practical issues of every-day web design and site building. I would strongly disagree. I code within the limitations of day-to-day, deadline driven, limitation riddled web design every day. I know many others who do as well. We have found ways, in a manner similar to those who started using tables for layouts, to cope with web design problems.

The Separation of Content, Presentation, and Layout

Because certain presentations, especially when it comes to layouts, are currently impossible or unreasonably difficult to implement using semantic HTML and CSS alone, many web developers have begun to separate their layout elements from their content and presentation. This allows them to achieve design goals and still make easy changes later. There are many ways to do this, including the following:

  • Class-name-based Search and Replace

    By naming each layout-specific element carefully, developers can do global search and replaces to make changes to layouts. Obviously, this is a very cumbersome and error-prone solution, but it allows developers to achieve the necessary presentation and move on with some kind of prayer that they will be able to modify all their layout elements should change be necessary later. Also obviously, use this solution as a last resort.

  • JavaScript Insertion

    Clever JavaScript coders have written scripts that will identify certain elements and then wrap them in non-semantic layout code. Some argue that this isn’t true separation of content and presentation, but it counts—the presentation is only meshed to the content at the browser level (not in the content source file), and the JavaScript can be turned off, leaving perfectly semantic code. This is a pretty good stop-gap measure to put in place while we wait for CSS and browsers to improve.

  • Inclusion of Layout Elements

    This is the server-side version of JavaScript Insertion—files are “included” at key points in the content source. These files contain the layout and presentational, not always semantic, HTML and CSS. They can be changed later to reflect improvements in CSS and browsers.

  • CMS-based Templates

    Templates are easily the most poweful method of separating layout from content. Because the system takes care of the leg-work of changing the pages based on a certain layout, these pages will be super-easy to modify and to update with more compliant HTML and CSS later.

These methods all rely on HTML and CSS for layout purposes. We don’t need a new technology to make this possible—I would simply say that there is a third class of information that needs to be considered. We have Content, which is what the elements say. We have Presentation, which is what the elements look like. And now we need to have a more robust system for Layout, which is where the elements are.

The Persistence of Separation of Content, Presentation, and Layout

There will always be some kinds of wrapper elements in HTML—these wrappers give semantic meaning to the HTML. They define what elements belong together. These wrappers can be used for layout purposes as well. But if the relationship of wrappers to elements ever changes, then it is very beneficial to have a method for easily updating the layouts of web pages. That’s one reason CMSs have become so popular. A web standards-compliant CMS or template system is basically a must for anyone building a site with more than 3-5 pages per layout or more than 10-15 pages total.

Because the locations of elements will change (independently of their content or appearance), HTML and CSS for layouts need to be managed separately, just like content and presentation are separated. Separation of content, presentation, and layout will further improve the power and robustness of web design, making site creation and maintenance easier and freeing up precious time for other important things.

 
 

Web Site Visualization

Like most heated debates, it is hard to come up with a definitive answer to the debate about whether or not it is still ok to use tables for web site layout. I don’t intend to provide a definitive answer in this post, but I would like to present another way of looking at the problem.

Evaluating Code

It can be very instructive to view the source code of web pages—pretend that you are a web spider, and that it is your job to ignore HTML, CSS, and Javascript in the search of pure content.

Look at some different sites, some laid out with tables, others with HTML and CSS, and see what the difference is. Which makes content more available? I’m not going to say what my opinion on the matter is here. Go do it yourself. Be honest and open-minded about what you find.

Web Site Visualization

Another way to compare table- vs. CSS-based pages is to use this web site visualization applet. The program takes a URL as input and then creates a visual map of that page. Each node is a different color and represents a different HTML tag or element.

Comparing Tables to CSS

Site Laid out with Tables

Let’s first examine a site laid out with tables.

The table site has many, many red nodes (table cells) and pink nodes (images used for site design purposes, not as inline information). If you examine the tree image carefully, these nodes appear to be out on their own, unattached to content, and simply weighing the site down. You could snip them right off the tree without missing them!

Content areas are represented by heavy clusterings of orange nodes. For this site, there are three different orange clusters, meaning the content is split into three different areas.

CSS-based Site

Next, let’s examine the CSS-based site. I selected this page to have about the same amount of content and a similar visual appearance to the table-based page.

First, notice how many fewer nodes there are period. Next, there are two images on the whole page—the site logo and a 1px image used for site stats tracking! Finally, all of the content is in one, accessible area.

Visual Path of the Blind

What these visualizations of web pages really are is a map of the visual path of the blind—both blind humans and blind spiders. The results say to me that it is worth pruning the trees of our sites in order to make them easier to get around!

 
 

Free HTML Tutorial - Tables

I’ve been putting off writing this free HTML tutorial for a long time… Tables are messy, tricky, and surrounded with controversy. They are, IMHO, the most abused tags in HTML. And a tutorial that teaches how to use them needs to be executed most carefully.

What are Tables For?

Before I even begin to dig into HTML tags or anything code specific, I want to discuss what tables are for.

In a non-Internet world, what are tables used for? Well, you put data into tabular form so that it’s easy to read. Financials, your Excel spreadsheets, names in the phone book, all are organized into tables in order to make the information easy to understand.

Tables are clearest when they have a title and labels for the information contained in rows and columns. Sometimes colors, lines, bolding, or different font sizes are used to make certain parts of the table stand out and improve the table’s clarity.

Tables are NOT intended to be used for site layouts. Can you imagine an advertisement or a piece of art with black lines all across it, dividing the drawing into nice little boxes? That’s the kind of reaction I have when I see a web site using tables for layout.

I suppose I should say tables should no longer be used for layout. In the earlier days of the web, tables were among the best layout methods available. Now, however, support for CSS has advanced to a level where tables are usually unnecessary for site layouts.

Tables are for tabular data.

Building a Table

In HTML, tables are very complex beasts. I’m going to put off the advanced features of tables and virtually all information about how to change a table’s appearance for future tutorials—this is meant to be a basic primer for tables. A really good advanced article you can read now, if you’d like, is 456 Berea St.’s Table Article

The first tags are <table> and </table> They tell your browser where the table begins and ends.

<table>
</table>

Tables are like sandwiches—you stack them. Inside of your table, you need to specify rows. A single row begins with <tr> and ends with </tr>. Here’s what our table code looks like with two rows:

<table>
   <tr></tr>
   <tr></tr>
</table>

Finally, we have the individual cells that make up each row. As a general rule of thumb, the number of cells in each row needs to be the same (there are some ways to work with this rule that I will explain later). Let’s add three cells to each row using <td> and </td> tags with some content in between.

<table>
   <tr>
      <td>Cell 1</td>
      <td>Cell 2</td>
      <td>Cell 3</td>
   </tr>
   <tr>
      <td>Cell 4</td>
      <td>Cell 5</td>
      <td>Cell 6</td>
   </tr>
</table>

Tada! Here’s our table, one of the most basic, complete tables that can exist:

Cell 1 Cell 2 Cell 3
Cell 4 Cell 5 Cell 6

Captions and Summaries

A good table will almost always have a caption or title to briefly describe what its contents are. We can also include a summary that will tell visitors using screen readers (and search engines) what content can be found in our table. A caption goes right after the <table> tag, like this:

<table>
<caption>Table 1: Some Data</caption>

A summary is an attribute added to the <table> tag:

<table summary=”Our data is a collection of information used to demonstrate tables.”>

Here’s how our table looks so far:

Table 1: Some Data
Cell 1 Cell 2 Cell 3
Cell 4 Cell 5 Cell 6

Table Headers: Column Labels

It’s good practice to tell people what the category of information in a column falls into. We’ll do this by adding a row that uses <th> and </th> tags to label each of the columns.

<table summary=”Our data is a collection of information used to demonstrate tables.”>
<caption>Table 1: Some Data</caption>
   <tr>
      <th>Header 1</th>
      <th>Header 2</th>
      <th>Header 3</th>
   </tr>
   <tr>
      <td>Cell 1</td>
      <td>Cell 2</td>
      <td>Cell 3</td>
   </tr>
   <tr>
      <td>Cell 4</td>
      <td>Cell 5</td>
      <td>Cell 6</td>
   </tr>
</table>
Table 1: Some Data
Header 1 Header 2 Header 3
Cell 1 Cell 2 Cell 3
Cell 4 Cell 5 Cell 6

Combining Cells

You can combine the cells in various columns or rows in order to make irregular tables. This is one of the tasks of creating tables that is the hardest.

Colspan combines cells that are in the same row to make them wider. The colspan attribute goes in the <td> tag of the cell you want to keep. Use colspan=”2″ to combine two cells, and larger numbers to combine more cells. Make sure to get rid of the extra cells that got combined together.

Rowspan combines cells in the same column to make them taller. This attribute also goes in a <td> tag. Make sure to eliminate the cells directly above and/or below the cell you want to keep. They will be found in different rows of the table. Here is a final example that shows some combined cells (I have highlighted some cells for illustration purposes only—the following code won’t highlight anything under normal circumstances).

<table summary=”Our data is a collection of information used to demonstrate tables.”>
<caption>Table 1: Some Data</caption>
   <tr>
      <th>Header 1</th>
      <th>Header 2</th>
      <th>Header 3</th>
   </tr>
   <tr>
      <td colspan=”2″>Cell 1</td>
      <td rowspan=”2″>Cell 3</td>
   </tr>
   <tr>
      <td>Cell 4</td>
      <td>Cell 5</td>
   </tr>
</table>
Table 1: Some Data
Header 1 Header 2 Header 3
Cell 1 Cell 3
Cell 4 Cell 5

Conclusion

Now that you know the basics of constructing tables, you are well on your way to being able to display tabular data clearly and efficiently on your web site. Later I will write about advanced table features and how to improve your tables’ appearance with stylesheets.

 
 

Web Site Redesign

One of my ongoing projects is to help out with my parents’ web site, www.kindredlearning.com. We sell home school and family curriculum, books, projects, and supplies. The site has a very loyal following of repeat customers, and it helps my parents to serve other families and to earn a little money on the side.

As you can see, the web site itself needs a little help. It’s still using the same template that I made for it in an afternoon nearly 3 years ago. The site is also hosted with a company that provides a WYSIWYG editor, but this editor is very clumsy and slow, and it severely constrains your access to resources to “keep you from messing things up.” For example, we don’t have access to an FTP server, there are no server-side includes of any sort, and it’s impossible to override the CSS that’s built into the system. The list goes on and on.

We decided not long ago that, since our knowledge of search engine optimization and web design are drastically greater than when we first started the site, we are going to switch hosting and redesign the web site.

Web Site Redesign

What’s it take to redesign a web site? I have a long list of things I know that I will have to change. There are also a lot of things that I’m sure we’ll find out along the way.

Because nearly every company will have to perform a web site redesign at some time, I’m going to try and document the whole process of rebuilding Kindred Learning’s site from the ground up so that you can learn from my mistakes and successes and get your web site redesign right.

I’m going to create a new category of posts specifically for web site redesign projects and discussions. Check out “Web Site Redesign” for my posts and progress redesigning Kindred Learning and other sites.