Categories
Articles

REPLACING THE -9999PX HACK (NEW IMAGE REPLACEMENT)

CSS 3 Logo
Replacing the -9999px hack shows a simple way to replace text with images that doesn't use the text-indent:-9999px hack.

It simply uses the following CSS:

.hide-text {

text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}

Very simple and avoids the 2 problems with the other technique – very long lines of text can flow into the container, and apparently (I've never hard this before) the old way can be slow on devices such as the iPad 1.

By Luiz A D R Marques

I've been developing software and selling it on-line since 1994. Current products include STG FolderPrint Plus - a tool to Print Folders, and STGThumb - HTML Album Generator, among others. Some of my other sites - Disk Usage, Directory Printer ,Print Folders and Jejum Intermitente .