Skip to content →

Tag: CSS2

Top Accessible WordPress themes

This assessment is very simplistic and constitutes a basic preliminary review. It is not comprehensive nor exhaustive.

I chose themes from the Free Theme Directory and searched for Web Accessible and Accessibility. I narrowed my selection by considering which theme would be easily customizable, have good contrast between foreground and background, have elements in a convenient location and be aesthetically pleasing as is.

I then used the plugin Demo Data Creator to generate more content for posts, pages, comments and categories.

The following themes made the cut:

Precious version 4.0.1
At first glance the layout is pretty simple and effective. Convenient breadcrumb on top of page. Upon disabling the style sheets, nothing is out of order. Validates for XHTML 1.0 Transitional and CSS2.

Stardust version 2.7
Very stylish out of the box with flexible width. Has “Skip to content” and “Skip to menu” without CSS. By disabling the images, the date for each post is too dark. Validates for XHTML 1.0 Strict, but not in CSS with 6 CSS2 errors.

Whitepress version 1.1.7
This theme includes a skip to content, navigation and search form when disabling CSS. Has a nice javascript for going through the sidebar items, but also works when javascript is disabled. Uses fixed width for 1024×768 resolution. Validates for XHTML 1.0 Strict, but not in CSS with 1 CSS2 error.

Dodo version 1.2.1
This theme is what this website is based on. The color of the posts date and other meta information is also too light. By disabling the images, the text of the main menu has not enough contrast with its background. With a little tweek here and there, it’s really nice. Fails to validate with XHTML 1.0 Strict with 1 error, but passes CSS2.

Precious and Stardust passed the Firefox Accessibility Extension 1.5.61.0 rule set with only warnings signaled .The themes Whitepress (2 Fails) and Dodo (1 Fail) did not pass.

For validation, I used Markup Validation Service and The W3C CSS Validation Service.

9 Comments

em, a unit of measure

The secret of the “em” is proportions. Keeping the appropriate proportions regardless of the size. Let’s use font-sizes as an example.

First, set a parent font-size as an absolute measurement. Let’s say 16 pixels in the body. All subsequent sizes use the following formula: child pixels/parent pixels = child ems. So if you want an h1 to have a pixel size of 24, then its em unit would be 1.5 (from 24/16).

Nested elements require particular attention, because they multiply on each level. If you have a div inside a div and the outer div has a font-size of 1.5em, then the inner div (div div) should be 1em to cancel its inheritance.

Now that the how is settled, let’s go to the why.

Other than WCAG 1.0 recommending the use of relative units (ei. em or %) as opposed to absolute units, there’s the fact that not all browsers deal with resizing in the same way. Some older browsers like IE6 won’t resize any absolute pixels.

The proper implementation of this guideline might be daunting for larger style sheets. My initial advice would be to break it down to specific sections. Have parent pixels on primary divisions and set your inner relative ems accordingly.

[Source: CSS for accessible web pages by Richard Rutten]

Leave a Comment

Case Study

So I recently re-did one of my old websites. My client wanted to had some images so I took the opportunity to give her an accessible site. I had done this site a few years ago. I wasn’t aware back then of web standards and web accessibility. I must confess of using tables for layout. But alas, I have done right by this website. I gutted it and made it new again. Although you can’t really see the difference between before and after! Let me show you what I mean:

Contact page before
Contact page before
Contact page after
Contact page after

They don’t look different, but I did change the code.

Here’s what I did:

  • I started by getting rid of the tables for layout purposes. I know!!! It’s all gone now.
  • Then I added the language to the html tag, lang=”en-US”, like this <html xmlns=”http://www.w3.org/1999/xhtml” lang=”en-US”>
  • I gave a more complete title to each page, like “Nadia Stevens Jin Shin Do Bodymind Acupressure Montreal”.
  • I repositionned some divs and wrapped them properly. Some classes and ids were not correctly placed, so I had to fix these. For instance, I had the same id used several times in the same file, so I changed these to classes.
  • Some images had misleading or inaccurate alternative text. Instead of “Fire” as the alt attribute for a chinese character representing fire, I wrote “Fire character”. In the instance where I had images that were not content related I made them blank text, like this: alt=””.
  • I got rid of widths and height attributes.
  • The menu of the page was not in a list, so a placed it in an unordered list.
  • For the maps, I added an onfocus attribute to every onmouseover attribute  and I added an onblur attribute to every onmouseout attribute.

The first page took me about 3 hours, additional pages took me 1 hour to 2 hours to renovate in the same way.

Ok so this site was easy to do because I had already a lot of div’s in the first place, but it really gave me an idea of how many things need to be thought of while in the process of revamping a site. This work is meticulous and a little repetitive, but if done with methodology, making any site accessible can be pretty painless.

Leave a Comment

Podcast Five – Advanced Accessibility

[podcast]http://thinkingaccessible.com/podcasts/advanced_accessibility_podcast_five.mp3[/podcast]

Transcript of the podcast:

[Intro music] Welcome to podcast five of Thinking Accessible. On today’s podcast I will talk to you about some advanced features in accessibility.

First on the menu I will talk about accesskeys. Accesskeys are keystrokes that we can trigger on the keyboard to go directly to a certain element or a certain page of your website. Accesskeys are to be combined with different HTML attributes, different HTML tags: the a, the area, the button, the input, the label, the legend, and the textarea. These are your choices for accesskeys. It’s recommended to use numbers 1 to 0 (o to 9). Don’t get carried away! As long as you have shortcuts to important links, this should suffice. For example, the UK has established standards for their accesskeys and they have a list of 11 shortcuts (that they deem important to use.) I would recommend to look at these options and choose the most appropriate ones for your web page.

For my blog, at thinkingaccessible.com, I will only need skip navigation which is the S keystroke, home page which is the 1 keystroke, search which is good and is the keystroke number 4, and accesskey details which is the page that explains the accesskeys used and this is the keystroke zero.

For every accesskey, it is a good idea to put a title with it, to explain exactly where it is redirecting the user.

For example, the accesskey 1 which will be going to the home page, you can title it: “Back to the home page. Accesskey 1″.

Ex:

<a href=”home.html” title=”Back to the home page. Accesskey 1″ accesskey=”1″>Home</a>

I got all this information through a really great article. You can check it out through a link on my blog: Article on Accesskeys

Next up, I think it’s important to discuss labelling forms. Once you get this, it’s super simple! Let’s look at a really basic example. For instance, we have a field for a name, so you type in Name for your label and then you have your input. For this example let’s say that the name attribute is “fullname”. Now for it to be accessible we need to add a label tag to the label itself. In this case, the label we have is Name:, we have to wrap it with the label tag and then we have to for attribute. This for attribute can also be called “fullname”, but remember that your input has to have an id with the same exact name. These two things work together, the for of the label and the id of the input. They work as a combination.

Like this: <label for=”fullname”>Name:</label> <input id=”fullname” name=”fullname”/ >

That’s basically it, that’s all you need to remember.

I have a link to the article in which I got this information: Article on Labelling forms.

My next topic is CSS relative font size. Why is it important to put relative font sizes? It’s for people to be able to change the size of the text in whichever browser they use. Nowadays the more modern browsers zoom the page, so this is not a big issue, but the older browsers have the old way of doing things that was to increase the size, but if this size is an absolute size then it won’t move, it won’t budge. But if it is relative size then it will relatively expand or diminish depending on what the user does. This is why it’s important to do this.

The way of implementing this is that your main body, the main text that you use at the beginning of your CSS stylesheet make it an absolute to the size you want most of your page to be that way you don’t have to worry about it in the future. Some people put 12, I like to put 14 px, pixels. But it’s really up to you. All the subsequent font sizes that you use on your CSS stylesheet, should be a relative number. Either use ems or percentages because it’s much easier to follow.

[Exit music] Well that’s it for today’s podcast. I would love to hear from you. Please come to my blog at thinkingaccessible.com and post some comments. Until next time!

Audio from ccMixter entitled “Café Connection“ by Morgantj under Creative Commons.  Creative Commons by Attribution 3

Leave a Comment

Podcast Four – Divide and Conquer

[podcast]http://thinkingaccessible.com/podcasts/divide_and_conquer_podcast_4.mp3[/podcast]

Transcript of the podcast:

[Intro music] Welcome to podcast four of Thinking Accessible. Today’s podcast is called Divide and Conquer. I will talk to you about layout versus content.

One of the keys of being successful in web standards is to divide the layout and the content.What I mean by this is that all the content related elements have to be in the HTML and everything else, like the style or the layout is in the CSS.

Your HTML code is strictly the tags that represent the content. So for example the <p> tag  is for paragraph, the <table> tag is for table, the <blockquote> tag is for big quote, etc. CSS is used to style the content. In other words, you use CSS to let’s say centre a page, make a certain <div> have a border, have a listed menu that is horizontal instead of vertical, remove or have different styles of image borders. So all it is is layout for us and it is done in the CSS.

Ok, now let’s see how this works. Please refer to thinkingaccessible.com for a textual transcript of this podcast where you can see exactly what I’m talking about.

So for example a horizontal menu. You would start by putting a <div> with an id, you can name it anything you want, but it should be something that you will recognize when you go to your CSS. I call (the id) menu. So you have your opening <div> with the id menu and then you can start your list. So it’s an unordered list and so you put the <ul> tag, and then you (place) your elements with the <li> tag, the list tag. It’s a menu so you have to put an <a href> tag with the location of that page and then you put the text, and you have the closing </a> tag, the closing </li> tag. So you repeat this as many times as your menu has items. You finish with a closing </ul> tag and the closing </div> tag.

<div id=”menu”>
<ul>
<li><a href=”home.html”>Home</a></li>
<li><a href=”about.html”>About</a></li>
<li><a href=”contact.html”>Contact</a></li>
</ul>
</div>

So now let’s look at the CSS of this. To start this menu id you can use a div to differentiate it from other maybe classes or you can just start with the number sign and then the name of your id. So in this case I have div, number sign, menu. And this one has padding of the menu and also the size of the font, so font-size is included in this one. The next one is the ul, because you want it to specifically target this id, the menu id, you put the ul right after this menu id. It follows the same order as in the HTML. The list-style is none, the list-style is if you want there to be a little circle beside the (text). We don’t want this in this case and it’s always a good idea to void the margin and the padding. The next one is the li tag and again you put the menu id right before it. To make this menu horizontal you have the display at inline which makes it all horizontal, you can also add some padding here for every element in your menu.

div#menu {
padding: 128px 0 0 220px;
font-size: 70%;
}

#menu ul {
list-style: none;
margin: 0;
padding: 0;
}

#menu li {
display: inline;
padding: 0 5px 0 4px;
}

(This is what is looks like:)

Horizontal menu list of Home About Contact
Horizontal menu list of Home About Contact

That was a simple example of how you (divide) HTML and CSS to have a better separation between the content and the layout.

[Exit music] That’s it for this podcast. I hope you found it useful. You can also see other content at my blog thinkingaccessible.com. Until next time!

Audio from ccMixter entitled “Café Connection“ by Morgantj under Creative Commons.  Creative Commons by Attribution 3

Leave a Comment

Forget CSS Opacity for now

It’s been trendy for a while now to play with transparency to simulate layers, but guess what? Yeap, you know it. It’s not valid under CSS2.

Stuff like opacity: .4 -moz-opacity: .4 filter: alpha(opacity=40) for the moment out of the question. We all have to wait patiently until CSS3. Yeah you heard me CSS3. If you did’t know, CSS2 is the current cascading style sheet language recognized by most of your browsers and it’s getting a face lift. Alas, the due date is unknown at this point.

If you want more information on this check out these important websites:
www.css3.info
www.w3.org/Style/CSS/current-work

Leave a Comment