Mozilla/Firefox/Gecko focus box resizing fix

I had an element which was focussable, but firefox resized it larger in order to display the focus rect, which caused scroll bars to appear and other annoying side-effects.

Here’s a piece of css which puts the focus rectangle inside the box, and in doing prevents the box from growing and changing the layout:

*:focus
{
-moz-outline-offset: -1px !important;
}

Advertisements

One Response to Mozilla/Firefox/Gecko focus box resizing fix

  1. Eric TF Bat says:

    Thank you – you saved me pulling what’s left of my hair out. Nicely done!

%d bloggers like this: