rgba for background color of IE7&IE8
来源:互联网 发布:淘宝手机发布宝贝教程 编辑:程序博客网 时间:2024/04/29 06:34
RGB色彩模式(也翻译为“红绿蓝”,比较少用)是工业界的一种颜色标准,是通过对红(R)、绿(G)、蓝(B)三个颜色通道的变化以及它们相互之间的叠加来得到各式各样的颜色的,RGB即是代表红、绿、蓝三个通道的颜色,这个标准几乎包括了人类视力所能感知的所有颜色,是目前运用最广的颜色系统之一。
RGBA在RGB的基础上多了控制alpha透明度的参数。以上R、G、B三个参数,正整数值的取值范围为:0 – 255。百分数值的取值范围为:0.0% – 100.0%。超出范围的数值将被截至其最接近的取值极限。并非所有浏览器都支持使用百分数值。A参数,取值在0~1之间,不可为负值
RGBA语法:
- div {
- background: rgba(0,0,0,0.5);
- }
浏览器兼容性:
RGBA和opacity的区别
opacity (filter: Alpha(Opacity=50) 或opacity:0.5)会使整个元素包括子元素透明,而RGBA仅仅是元素本身透明,子元素不透明。
下面具体讲讲怎样让IE浏览器支持RGBA颜色
一、CSSPIE
CSSPIE可以让color、background、 box-shadow支持RGBA
示例:
- div{
- color:rgba(0,0,0,.5);
- background:rgba(0,0,0,.5);
- -pie-background:rgba(0,0,0,.5);/*IE6-8*/
- box-shadow:1px1px rgba(0,0,0,.5);/*仅在未设置模糊值的情况下支持rgba*/
- }
二、filter
通过IE滤镜让背景色透明,模拟rgba效果,不会影响子元素的背景透明度.
示例:
- .filter{
- filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#BF000000,endColorstr=#BF000000);
- }
我们需要留意的是StartColorStr和EndColorStr的值,前两位是十六进制的透明度,后面六位是十六进制的颜色。
换算方法:x=alpha*255 将计算的结果x转换成十六进制即可.
1、在你的网页加载 PIE.js (官方下载地址:http://css3pie.com/download-latest)。
注意,用IE专用的注释,防止非IE浏览器下载。
<!--[if lt IE 10]>
<script type="text/javascript" src="PIE.js"></script>
<![endif]-->
2、用js 调用:
$(function() {
if (window.PIE) {
$('.rounded').each(function() {
PIE.attach(this);
});
}
});
0 0
- rgba for background color of IE7&IE8
- background-color:rgba与rab
- color:rgba(red,green,blue,alpha)和background-color:rgba(r,g,b,a)
- ie7,ie8背景图片background-size无效问题
- 当IE8 background-color不生效时
- Background:rgba()
- gedit set the color of background
- Change the xterm background color for ICEWM
- The session of IE7 and IE8
- 透明-----css的filter,opacity与css3的background-color: rgba
- background:rgba()兼容性
- background-color
- 兼容ie8 rgba()用法
- IE8兼容rgba
- 兼容ie8 rgba()用法
- IE8浏览器的rgba
- IE8 兼容rgba
- IE7&IE8
- CreateThread和_beginthread的区别
- fsfsfd
- How To Install 11.2 / 12.1 Database/Client Software In Silent Mode Without Using Response File
- [20140101_Example05(Supplication)]基本的Windows应用程序、类的继承
- Opencv Mat 多通道时 元素访问问题
- rgba for background color of IE7&IE8
- 使用node.js cheerio抓取网页数据
- inotify -- Linux 2.6 内核中的文件系统变化通知机制
- 异常控制try,catch用法小结
- javascript 对象数组排序
- 程序设计之MVC工作分配,关于客户端开发之我鉴(三)
- 超实用且高效的线框设计工具
- HDU4716
- 提升文学修养