Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to draw a "smart" border in Javascript / CSS?

I mean something like this (look at the kids playing soccer tile). See how it increases the brightness of each pixel of the arbitrary picture? How do I do that with jQuery and/or CSS?

like image 374
Jason Avatar asked Dec 07 '22 19:12

Jason


2 Answers

One option is to kind of fake it with a very small inset box shadow:

 box-shadow: inset 0px 0px 5px 0px #ffff66;

Click here for an example.

like image 67
Kyle Avatar answered Dec 10 '22 11:12

Kyle


Take a look at this: jsFiddle. Using a white-transparent border and the image starting at the same position as the border does the trick.

like image 26
Martin Matysiak Avatar answered Dec 10 '22 12:12

Martin Matysiak