<Html> <pead> <title> CSS adds a shadow to an image </title> <style> * {padding: 0; margin: 0;} body {background: # E8EDF1; padding: 20px ;}# profileAvatar {overflow: hidden; zoom: 1 ;}# profileAvatar I {float: left; visibility: hidden; background: url (http://files.jb51.net/demoimg/200912/avatar.gif) 0 0 no-repeat ;}# profileAvatar I {background-position: 100% 0 ;}# profileAvatar I {background-position: 0 100% ;} # profileAvatar I {padding: 0 5px 6px 0; background-position: 100% 100% ;}# profileAvatar img {visibility: visible; display: block; padding: 3px; border: 1px solid # ccc; background: # fff ;} </style> </pead> <body> <I> </I> move to show smooth shadow <input type = "button" value = "zoom out image" onclick = "document. getElementById ('image '). width-= 10; "/> </body> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]