CSS趣味图片边框之——带间隔的大边框代码,看似简单,为什么别人做出来都挺漂亮呢?这就是配色和审美的因素了,好好学习一下吧,本效果用最简的代码写出的,其实还可以再精简,不过兼容性就变差了。 <!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> <meta http-equiv="Content-Type" content="text/html; charset=gbk" /> <title>图片边框 - Liehuo.Net</title> <style type="text/css"> body { margin: 0 auto; text-align: center; padding: 0 0 50px; font: 12px Arial, Helvetica, sans-serif normal; } img.double-border { border: 5px solid #ddd; padding: 5px; background: #fff; } </style> </head> <body> <h2>CSS图片边框</h2> <img class="double-border" src="http://www.veryhuo.com/uploads/common/images/liehuo_net_600x400_1.jpg" alt="" /> </body> </html> <br /><center>如不能显示效果,请按Ctrl+F5刷新本页,更多网页代码:<a href='http://www.veryhuo.com/' target='_blank'>http://www.veryhuo.com/</a></center>提示:可修改后代码再运行! 文章导航 CSS结合PNG图片打水印的实现代码CSS给图片的边框添加阴影效果