不用背景圖也可實現圖片陰影,只可惜只支持標準瀏覽器,ie6是被pass掉的,ieTester下7也沒效果。請用火狐或Opera瀏覽。不過算是個小小的研究,開拓下思維。
代碼已經壓縮作爲附件。效果截圖如下:
主要代碼:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<style type="text/css">
body {
font-size:62.5%;
}
p {position:relative;padding:0;margin:0;font-size:14em;font-weight:bold;color:#fff;text-shadow:#333 5px 5px 10px;}
img {position:absolute;left:20px;top:20px;}
</style>
</head>
<body>
<p>□
<img src="kitty.jpg" alt="" />
</p>
</body>
</html>