Depending on your intended browser support, you can use the box-shadow property.
You can set the blur value to 0, and the spread to any thickness. The great thing about the shadow box is that you can control whether it will be brought out (by default) or inside (using the inset property).
Example:
box-shadow: 0 0 0 1px black;
or
box-shadow: 0 0 0 1px white inset;
A huge advantage of using a shadow window is that you can get creative using a few box shadows:
box-shadow: 0 0 0 3px black, 0 0 0 1px white inset;
The only thing I canβt say is that this will do the rendering. I would suggest that this could be a problem if you had hundreds of elements that used this method on screen right away.
James Bryant Feb 10 '13 at 23:50 2013-02-10 23:50
source share