One of the main advantages of using a purely CSS-based layout is that it is easy to rearrange elements within your HTML source without affecting the visual layout, so that your main content displays while the rest of the page is still loading. However, I am aware that most weblogs still use table-based layouts, so this tip is for you.
If you have a table-based layout with a navigation bar along the left, your navigation bar is being presented to blind users like Marcus and Jackie before your main content. There is no way to describe how much of a problem this is; you have to see it for yourself:
You do not need to redesign your entire template from scratch to avoid this problem. There is a (relatively) simple technique, affectionately called the “table trick”, that can present your main content first, while still keeping your navigation bar on the left side.
View your own site in the Lynx Viewer and see if your daily posts are displayed first, before your navigation bar. The Movable Type default template gets it right; if you use the default template or something based on it, you probably do not need to do anything. But view your site in the Lynx Viewer anyway, because it will give you a deeper understanding of the issues involved.
If you are using one of the default Radio templates, you may need to adjust your tables to put your main content first. There is no specific copy-and-paste way to do this; you will have to dig into your own weblog template and look at the table structure. The sample layout and modified sample layout show the basic technique.
Instead of the obvious table layout:
<table> <tr> <td valign="top" align="left" width="25%"> ... navigation bar ... </td> <td valign="top" align="left"> ... main content ... </td> </tr> </table>
We do this instead:
<table> <tr> <!-- spacer GIF in upper-left cell --> <td><img src="/images/1.gif" width="1" height="1" alt=""></td> <!-- main content cell first, with rowspan=2 --> <td valign="top" align="left" rowspan="2"> ... main content ... </td> </tr> <tr> <td valign="top" align="left" width="25%"> ... navigation bar ... </td> </tr> </table>
I’ll give you the whole weekend to hack on it.
§
I am no longer accepting public comments on this post, but you can use this form to contact me privately. (Your message will not be published.)
§
© 2001–9 Mark Pilgrim