纯CSS图片放大效果

<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > 
< html > 
< head > 
< meta  http-equiv ="Content-Type"  content ="text/html; charset=gb2312"   /> 
< META  NAME ="Author"  CONTENT ="hhshushu"   /> 
< META  NAME ="Keywords"  CONTENT ="纯CSS图片放大效果"   /> 
< META  NAME ="Description"  CONTENT ="纯CSS图片放大效果"   /> 
   < title >纯CSS图片放大效果 </ title > 
     < style  type ="text/css"  title ="" >  
       body
{ width : 320px ; margin : 0 auto ; padding : 20px ; background : #000 ; color : #000 ; }  
       #main-content
{ border : 5px solid #7bc809 ; padding : 5px ; background : #fff  ; }  
          ul
{  margin : 0 ; padding : 0 ; list-style : none ; padding-bottom : 300px ;   /* padding给图片撑开空间 */ }  
          li
{ display : inline ; }  
          li a
{ position : relative ; }  
          li a:hover
{ position : relative ; border : none ; z-index : 1000 ; } /* 此处要有border:none属性,否则IE6下面无法显示出来,是IE6伪类的BUG */  
          li a img
{ width : 100px ; height : 100px ; border : none ; position : absolute ; } /* 使用绝对定位让图片固定从而脱离页面流 */  
          li a:hover img
{ position :   absolute ; left : -10px ; top : -50px ; width : 240px ; height : 240px ; padding : 5px ; background : #fff ; border : 2px solid #000 ; z-index : 1000 ; }   /* 注意这里的z-index显示设置,否则会有重叠 */  
         li#pic-01 a img
{ top : 0 ; left : 0 ; }  
         li#pic-02 a img
{ top : 0 ; left : 100px ; }  
         li#pic-03 a img
{ top : 0 ; left : 200px ; }  
         li#pic-04 a img
{ top : 100px ; left : 0 ; }  
         li#pic-05 a img
{ top : 100px ; left : 100px ; }  
         li#pic-06 a img
{ top : 100px ; left : 200px ; }  
         li#pic-07 a img
{ top : 200px ; left : 0px ; }  
         li#pic-08 a img
{ top : 200px ; left : 100px ; }  
         li#pic-09 a img
{ top : 200px ; left : 200px ; }
                  
/* 定位图片的排布 */  
  
</ style > 
</ head > 
< body >
   < div  id ="main-content"   >
     < ul > 
       < li  id ="pic-01" >< href ="http://bbs.blueidea.com" >< img  src ="http://bbs.blueidea.com/images/default/logo.gif"  alt ="图1"   /></ a ></ li > 
       < li  id ="pic-02" >< href ="http://bbs.blueidea.com" >< img  src ="http://bbs.blueidea.com/images/default/logo.gif"  alt ="图2"   /></ a ></ li > 
       < li  id ="pic-03" >< href ="http://home.blueidea.com/apps.php?do=case&ac=lists&uid=560226&picid=68256" >< img  src ="http://home.blueidea.com/attachment/201102/24/560226_12985459674K0h_t.jpg"  alt ="图3"   /></ a ></ li > 
       < li  id ="pic-04" >< href ="#" >< img  src ="#"  alt ="图4"   /></ a ></ li > 
       < li  id ="pic-05" >< href ="#" >< img  src ="#"  alt ="图5"   /></ a ></ li > 
       < li  id ="pic-06" >< href ="#" >< img  src ="#"  alt ="图6"   /></ a ></ li > 
        < li  id ="pic-07" >< href ="#" >< img  src ="#"  alt ="图7"   /></ a ></ li > 
        < li  id ="pic-08" >< href ="#" >< img  src ="#"  alt ="图8"   /></ a ></ li > 
        < li  id ="pic-09" >< href ="#" >< img  src ="#"  alt ="图8"   /></ a ></ li > 
      </ ul > 
   </ div > 
</ body > 
</ html >
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值