首页 > 编程知识 正文

css按钮颜色怎么设置,html设置字体颜色代码

时间:2023-05-04 23:19:35 阅读:126901 作者:4745

经过一些游戏,发现了

getComputedStyle,我已经把这个在一起了。

#element {

背景色: RGB (10,10,10 );

背景色: rgba (10、10、10、1 );

}

hml element.prototype.alpha=function {

current _ color=getcomputedstyle (this ).getpropertyvalue ) (background-color );

match=/rgba? ((d ) s*,s* ) (d ) (s*,s* ) (d ) ) s* ),s*d [.d ]* ) ) ) g.exec )抄送

a=a 1? (a/100 ) : a;

this.style.background color=' rgba ' [ match [1],match[2],match[3],a].join ';

}

this is some内容。

e=document.getelementbyid (element );

e .阿尔法(20;

由于RGBA为css3,因此请定义CSS的值并确保级联。 另外,1是alpha,可以传递将其除以100的值(使用小数时不喜欢考虑百分比)。 玩得开心!

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。