Leave That Thing Alone Blog

A More Accessible Map

I'm very excited to have my "A More Accessible Map" article in A List Apart. The article describes how to create a map using CSS and DOM Scripting that is interactive and also accessible. You can read the full article here: http://www.alistapart.com/articles/cssmaps

I have made some code and worldmap image files available for the CSS map example. A ColdFusion CSS Map example is also available.

I want to thank the people at A List Apart, and I have to give a huge amount of thanks to Aaron Gustafson. Aaron was the production editor for the article; he made a bunch of great suggestions on improving the scripting and really made this a much better example and article.

Several scripting links I found very helpful:
http://www.wait-till-i.com/index.php?p=239
http://dean.edwards.name/weblog/2005/10/add-event/

I have also updated my CFCPhotoBlog to include the CSS mapping technique. The CSS map technique can be seen in action on the Photos By Location page.

Using col to add a style to an entire table column

By adding a style to a COL it is possible to add (some) styles to an entire table column without having to specify classes in each TD of the table column.

Adding styles with colgroup and col was new to me so i thought I'd share. There are limitations to the types of styles that can be applied to a col. Here's a basic example:

Col 1 Col 2 Col 3 Col 4 Col 5
a b c d e
f g h i j

Example code:

<style media="all" type="text/css">
   table#testcol {
      width:300px;
      border:#333 1px solid;
      background:#f8f8f8;
   }
   table#testcol col.altcol {
      background:#69C;
   }
</style>

<table id="testcol">
   <colgroup>
      <col></col>
      <col span="2" class="altcol"></col>
      <col></col>
      <col class="altcol"></col>
   </colgroup>
   <tr>
      <th>Col 1</th>
      <th>Col 2</th>
      <th>Col 3</th>
      <th>Col 4</th>
      <th>Col 5</th>
   </tr>
   <tr>
      <td>a</td>
      <td>b</td>
      <td>c</td>
      <td>d</td>
      <td>e</td>
   </tr>
   <tr>
      <td>f</td>
      <td>g</td>
      <td>h</td>
      <td>i</td>
      <td>j</td>
   </tr>
</table>

CSS side tab navigation using submit buttons

Here is another example of CSS tabbed navigation where tabs are created with submit buttons instead of anchor tags. This allows a form to be submitted each time a tab is clicked.

My last example was horizontal tabs, but when using those for a new project I ran out of room and had to create vertical side tabs. Here is what I ended up coming up with:


Here is a basic example of the CSS submit button side tab navigation.

CSS tab navigation using submit buttons

Here is an example of CSS tabbed navigation where the tabs are created with submit buttons instead of anchor tags. This allows a form to be submitted each time a tab is clicked.
tab submit button navigation

I couldn't find a good example of submit buttons as tabs out there so I made one myself. It displays almost identically on browsers I have tested so far. If you come across something weird or have suggestions to improve the tabs please email me.

CSS submit button tab navigation example

What's Coming up in CSS3

Take a look at just some of the really cool things on the working draft of CSS3 Backgrounds and Borders Module http://www.w3.org/TR/css3-border/

  • SVG support in background images
  • background images can be stretched or size relative and absolute
  • Multiple background images can be layered
  • More border syles
  • Borders can be given images
  • Border radius (both width & height of radius can be set)
  • Drop shadows for block elements