当前位置: css > DIV+CSS实例 >

用透明图片实现css圆角的效果

时间:2010-01-01 10:24来源:网络 作者:秩名 点击:
本例是用gif图片实现 css圆角 图片的效果。 原理:采用一个圆角中间透明的gif图片欺骗,然后把所要调用的图片用css的background,通过调用背景图片的方式实现,实例效果如下 !DOCTYPEht

本例是用gif图片实现css圆角图片的效果。

原理:采用一个圆角中间透明的gif图片欺骗,然后把所要调用的图片用css的background,通过调用背景图片的方式实现,实例效果如下

css图片圆角
 
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
  2. <html xmlns="http://www.w3.org/1999/xhtml"> 
  3. <head> 
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 
  5. <title>用透明图片实现图片圆角效果www.csschina.net</title> 
  6. <style> 
  7. div ul { list-style:none;}  
  8. div ul li { float:left; margin:6px;}  
  9. </style> 
  10. </head> 
  11.  
  12. <body> 
  13. <div> 
  14.   <ul> 
  15.     <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> 
  16.     <li><img style="background:url(/uploadfile/200808/21/950444001.jpg)" src="/uploadfile/200808/21/951111689.gif" width="240" height="185" /></li> 
  17.     <li><img style="background:url(/uploadfile/200808/21/95100281.jpg)" src="/uploadfile/200808/21/951111689.gif" width="240" height="185" /></li> 
  18.     <li><img style="background:url(/uploadfile/200808/21/950444001.jpg)" src="/uploadfile/200808/21/951111689.gif" width="240" height="185" /></li> 
  19.   </ul> 
  20. </div> 
  21. </body> 
  22. </html> 

 

顶一下
(0)
0%
踩一下
(1)
100%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
验证码:点击我更换图片
推荐内容
赞助商