用透明图片实现css圆角的效果
时间:2010-01-01 10:24来源:网络 作者:秩名 点击:次
本例是用gif图片实现 css圆角 图片的效果。 原理:采用一个圆角中间透明的gif图片欺骗,然后把所要调用的图片用css的background,通过调用背景图片的方式实现,实例效果如下 !DOCTYPEht
本例是用gif图片实现css圆角图片的效果。
原理:采用一个圆角中间透明的gif图片欺骗,然后把所要调用的图片用css的background,通过调用背景图片的方式实现,实例效果如下
- <!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=gb2312" />
- <title>用透明图片实现图片圆角效果www.csschina.net</title>
- <style>
- div ul { list-style:none;}
- div ul li { float:left; margin:6px;}
- </style>
- </head>
-
- <body>
- <div>
- <ul>
- <li><img style="background:url(/uploadfile/200808/21/95100281.jpg) 0 0 no-repeat" src="/uploadfile/200808/21/951111689.gif" width="240" height="185" /></li>
- <li><img style="background:url(/uploadfile/200808/21/950444001.jpg)" src="/uploadfile/200808/21/951111689.gif" width="240" height="185" /></li>
- <li><img style="background:url(/uploadfile/200808/21/95100281.jpg)" src="/uploadfile/200808/21/951111689.gif" width="240" height="185" /></li>
- <li><img style="background:url(/uploadfile/200808/21/950444001.jpg)" src="/uploadfile/200808/21/951111689.gif" width="240" height="185" /></li>
- </ul>
- </div>
- </body>
- </html>
|
------分隔线----------------------------