CSS tests: tips and gotchas

Sometimes people ask me what's the point in creating a so huge collection of CSS tests. So here are some explanations. First of all, the tests I made are just the result of a good amount of spare time. Being unemployed for a long time forces you to do something with your time schedules. Usually I started wondering about some issues with CSS layouts, for example about floats, positioning and the like and then I used to create a test case that could show why something worked or not. These are basically how my first tests look like to a visitor stumbling for the first time on them. But then came the W3C CSS Test Suite, where I had to get rid of my bad coding habits and get used to code following certain rules.

These kind of CSS tests are rather cryptic, because you have to look at the meta information of the page to see how they should work. I think that these tests are not very useful for a casual reader. It's better to stick to complete layouts and demos to get an idea about how a certain combination of properties should work together. So you should make a choice: W3C testing style or your own testing style. Be aware, however, that your custom style should be self-explanatory or you'll probably end up with receiving mails from people saying "Man, I didn't understand how to do this and that.".

When you make a test, just simply ask yourself what you're going to demonstrate. If it's not clear in your mind what you're going to show to your visitors, it's more likely that you'll fail with your purpose. Second, be clear, Third, even with complex layouts, write a good explanation about how your page should look like and, if proper, provide some screenshots. Remember: if something is not clear to you, it's likely that even your readers will have problems with your tests. So theory first: read the CSS specifications, read tests made by other developers, read the most relevant tutorial on the topic of your choice and, finally, be creative. Further, be ready to update your tests when browser support changes or a new bug comes along. By doing so, your tests will be simply useful and your visitors will be happy.

Leave a Reply

Note: Only a member of this blog may post a comment.