skip to content

Nicholls active/focus image replacement

22nd January 2006

IMAGE 1

Normal Phark Image Replacement technique with dotted border error in Firefox

CSS PLaY

IMAGE 2

Revised technique to restyle the dotted border using JUST CSS

CSS PLaY

Information

There has been much discussion recently on the best way to remove the active/focus dotted borders when using the Phark Image Replacement technique. The problem arises in Firefox, which insists on making the border stretch around the 'off-screen' text. If you are using Firefox, click the first image and you will see what I mean.

The border shoots off the screen to the left causing an unsightly line of dots.

The current methods get rid of the border altogether in Firefox but leave it in place in Internet Explorer. Not really a cross browser answer with one method even failing css validation.

In my technique the dotted border is removed in ALL browsers and replaced with a css styled alternative and, what is more, uses validating css and NO javascript (direct or indirect).

Click on the second image and see that the dotted border is gone and replaced by a border color change from black to red. This, of course, can be styled as you wish to fit in with the look of your site.

This technique does require an extra element around the text but I don't think this is too much for a validating css answer.

The embeded css shows how this is achieved and uses the nicholls DOTTED LINE REPLACEMENT technique which reduces the actual link to zero size and styles the inner element instead. The CSS is commented where necessary to explain the styling requirements.

Copyright

You may use this method on your personal 'non-profit' web site without seeking my permission. A link back to CSSplay is always appreciated.

Commercial usage is also permitted without seeking approval, but I would ask that a donation is considered to support my work on CSSPlay.

If you are having problems integrating any of my demonstrations into your website then I now offer a service to fault find and correct any errors that you may have introduced. Please email me for more information.




Recommended Sites

CSSplay web design/assistance

"The citroen.co.uk web site uses
CSS Play code for the site drop down menus.
This code works seamlessly in IE 6 & 7, and is an excellent solution to the Creative requirements of the site."

Damon Clark - Brandwidth


Advertise with CSSplay

CSS play pages

CSS (Design) - TOP.ORG

CSS play recommend

Earn from your site today with Netklix text adsSitegrinderPSD to HTMLFree, practical CSS menus, layouts, and examples