Text

The purpose of link title attributes

I always thought that link title attributes (i.e., the little tooltips you get when hovering over a link) are important for accessibility. Turns out, I was mistaken.

Actually most screen-readers will not read the title attribute of a link when there is also link text in the anchor. Also most keyboard only users will not get the content of the title attribute as it is usually only available to those with a pointing device.

[…] Bottom line is that title is for non-important information, users must be able to determine the purpose of a link without using the content of the title attribute.

- Source

Text

Clearing floats with overflow: hidden

There are a lot of methods for clearing floats. Clearfix is still popular (for some reason), and you still see a lot of <div class="clear" /> going around as well. For awhile, I used overflow: auto which worked fine except that it sometimes gave you nasty scrollbars.

Then I realized overflow: hidden does the same thing without the risk of scrollbars. Just give overflow: hidden to the container that contains the floated elements, and anything below that container will be cleared underneath it. Here’s an example:

Tags: HTML CSS