首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

更动图片背景

2012-11-21 
更改图片背景初次写这个程序的时候我以后是设置图片的背景色,殊不知自己是多么愚蠢,只有把图片当作当作背

更改图片背景
初次写这个程序的时候我以后是设置图片的背景色,殊不知自己是多么愚蠢,只有把图片当作当作背景色的,哪有给图片设置背景色的???就是设了背景色,也会被图片自身的颜色覆盖。

<style type="text/css">
.sm{width:222px;height:54px;margin:0 10px 0 0;filter: Alpha(Opacity=100);Opacity:1.0;-moz-opacity:1.0;}
.big{width:290px;height:180px;margin:0 10px 0 0;filter: Alpha(Opacity=40);Opacity:1.0;-moz-opacity:1.0;}
</style>
上面这段css代码修改了图片的大小,色度等等。
    <div style="float:left; ">
   <div >
     <img src="1.jpg" alt="更动图片背景"   onmouseover="this.className='big'" onmouseout="this.className='sm'"/></div>
   <div >
     <img src="2.jpg" alt="更动图片背景" onmouseover="this.className='big'" onmouseout="this.className='sm'"/></div>
     <div >
      <img src="3.jpg" alt="更动图片背景"onmouseover="this.className='big'" onmouseout="this.className='sm'" /></div>
   <div >
     <img src="4.jpg" alt="更动图片背景" onmouseover="this.className='big'" onmouseout="this.className='sm'"/></div>
     <div >
      <img src="5.jpg" alt="更动图片背景" onmouseover="this.className='big'" onmouseout="this.className='sm'"/></div>
   
    </div>

热点排行