头闻号

浙江冠宇管业有限公司

无缝管|方矩管|焊管|工业锅炉及配件|优特钢|钢坯

首页 > 新闻中心 > 科技常识:什么是CSS3 HSLA色彩模式?HSLA模拟渐变色条
科技常识:什么是CSS3 HSLA色彩模式?HSLA模拟渐变色条
发布时间:2023-02-01 10:50:31        浏览次数:4        返回列表

今天小编跟大家讲解下有关什么是CSS3 HSLA色彩模式?HSLA模拟渐变色条 ,相信小伙伴们对这个话题应该有所关注吧,小编也收集到了有关什么是CSS3 HSLA色彩模式?HSLA模拟渐变色条 的相关资料,希望小伙伴们看了有所帮助。

HSLA色彩模式是HSL色彩模式的扩展,在色彩,饱和度,亮度三要素的基础上增加了不透明度参数。使用HSLA色彩模式,可以设计不同的透明效果。 语法:

hsla(<length>,<percentage>,<percentage>,<opacity>)

表示不透明度,取值在0和1之间。

实例:模拟渐变色条

XML/HTML Code复制内容到剪贴板 <!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <htmlxmlns="http://www.w3.org/1999/xhtml"> <head> <metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/> <title>HSLAColor</title> <styletype="text/css"> div{height:20px;} div:nth-child(1){background:hsla(120,50%,50%,0.1);} div:nth-child(2){background:hsla(120,50%,50%,0.2);} div:nth-child(3){background:hsla(120,50%,50%,0.3);} div:nth-child(4){background:hsla(120,50%,50%,0.4);} div:nth-child(5){background:hsla(120,50%,50%,0.5);} div:nth-child(6){background:hsla(120,50%,50%,0.6);} div:nth-child(7){background:hsla(120,50%,50%,0.7);} div:nth-child(8){background:hsla(120,50%,50%,0.8);} div:nth-child(9){background:hsla(120,50%,50%,0.9);} div:nth-child(10){background:hsla(120,50%,50%,1);} </style> </head> <body> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> </body> </html>

演示效果:

以上就是本文的全部内容,希望对大家的学习有所帮助。

来源:爱蒂网