小白教程
所有教程
关于
Search
172.70.127.6
172.70.127.6
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Css3 pr opacity”的源代码
本页内容
上一节:
Css3_pr_rotation_point
下一节:
Pr_padding
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:opacity}}[[Category:css reference|89]] = CSS3 opacity 属性 = 设置一个div元素的透明度级别: <sample title="" desc="" lang="html" hererun="1"> div { opacity:0.5; } </sample> <run name=""> <!DOCTYPE html> <html> <head> <style> div { background-color:red; opacity:0.5; filter:Alpha(opacity=50); /* IE8 and earlier */ } </style> </head> <body> <div>This element's opacity is 0.5! Note that both the text and the background-color are affected by the opacity level!</div> </body> </html> </run> 在此页底部有更多的例子。 == 浏览器支持 == 所有主流浏览器都支持opacity属性。. '''注意:'''IE8和早期版本支持另一种过滤器属性。像:filter:Alpha(opacity=50) == 属性定义及使用说明 == Opacity属性设置一个元素了透明度级别。 {| class="table table-striped table-hover" | 默认值: | 1 |- | 继承: | no |- | 版本: | CSS3 |- | JavaScript 语法: | object.style.opacity=0.5 |} == 语法 == <pre> opacity: value|inherit;</pre> {| class="table table-striped table-hover" ! 值 ! 描述 |- | value | 指定不透明度。从0.0(完全透明)到1.0(完全不透明) |- | inherit | Opacity属性的值应该从父元素继承 |} == 更多实例 == [[try.php?filename=trycss3_opacity_js|更改某个元素的不透明度]] 这个例子演示了如何使用JavaScript来改变元素的不透明度。
返回至“
Css3 pr opacity
”。
上一节:
Css3_pr_rotation_point
下一节:
Pr_padding