Yep: use the outline property; it acts like a second border beyond your border. Beware tho 'he can interact in a winning manner with margins, paddings and drop-shadows. In some browsers, you may have to use a browser prefix; to make sure he types this: -webkit-outline and the like (although WebKit in particular does not require this).
It can also be useful if you want to reset the scheme for certain browsers (for example, if you want to combine the outline with shadow shadow printing, and in WebKit the outline is inside the shadow; FireFox is outside, so -moz-outline: 0 is useful to make sure you don't get a gnarly string around a beautiful CSS shadow).
.someclass { border: 1px solid blue; outline: 1px solid darkblue; }
Edit: Some people have noted that outline does not do very well with IE <8. Although this is true; supporting IE <8 is really not what you should be doing.
Williham Totland Oct 11 2018-10-11 14:17
source share