html图形透明度,图像透明度大法(opacity)

定义和用法

opacity 属性设置元素的不透明级别。

c95d6548b3f6badb3ba4c160bdbc04ef.png

语法

opacity: value|inherit;

acb1cfb9b6d1d9e653b1b9b0caa26cd9.png

实例一:创建透明图像

31b86da31eb0697707ea11221c98bd57.png

img

{

opacity:0.4;

filter:alpha(opacity=40); /* For IE8 and earlier */

}

img:hover

{

opacity:1.0;

filter:alpha(opacity=100); /* For IE8 and earlier */

}

图像透明度

Peach Blossom

注释:在 IE 中,必须添加 ,这样才能将 :hover 选择器用于除了 之外的其它元素。

实例二:半透明框中加文本

呈现方式

723af1c1c6dce0a3067ccedab50f90f1.png

.background

{

width: 400px;

height: 266px;

background: url(http://pic.58pic.com/58pic/15/36/00/73b58PICgvY_1024.jpg) no-repeat ;

border: 1px solid black;

}

.transbox

{

width: 338px;

height: 204px;

margin:30px;

background-color: #ffffff;

border: 1px solid black;

/* for IE */

filter:alpha(opacity=60);

/* CSS3 standard */

opacity:0.6;

}

.transbox p

{

margin: 30px 40px;

}

This is some text that is placed in the transparent box.This is some text that is placed in the transparent box.This is some text that is placed in the transparent box.This is some text that is placed in the transparent box.This is some text that is placed in the transparent box.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值