CSS学习(十六)-HSLA颜色模式
一、理论:
1.HSLA颜色模式
a.HSLA在HSL基础上添加了不透明度,值越大透明度越低
b.HSLA颜色模式的浏览器兼容性和HSL一样,仅仅有较新版本号的主流浏览器才支持
2.RGBA和HSLA颜色模式二者能够全然相互替换
3.RGBA/HSLA的IE兼容方案
a.在IE8下面版本号。一般在前面设置一个非透明色,在其后紧跟一个RGBA/HSLA颜色模式
b.将透明的PNG图片平铺做为背景图片,适用于ie7-8
c.使用Gradient滤镜能够指定半透明颜色。将起止色设置为同一种颜色就可以避免产生渐变
二、实践:
1.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style type="text/css">
.row{
overflow: hidden;
}
.row div{
width: 80px;
height: 80px;
line-height: 80px;
text-align: center;
float:left;
}
.row:nth-of-type(1) div {
background: hsla(183,50%,50%,1);
}
.row:nth-of-type(2) div {
background: hsla(133,50%,50%,.8);
}
.row:nth-of-type(3) div {
background: hsla(133,50%,50%,.6);
}
.row:nth-of-type(4) div{
background: hsla(133,50%,50%,.4);
}
.row div:nth-child(1){
background: hsla(133,50%,50%,.2);
}
.row div:nth-child(2){
background: hsla(133,50%,50%,.1);
}
.row div:nth-child(3){
background: hsla(133,50%,50%,.2);
}
.row div:nth-child(4){
background: hsla(133,50%,50%,.3);
}
.row div:nth-child(5){
background: hsla(133,50%,50%,.4);
}
.row div:nth-child(6){
background: hsla(133,50%,50%,.5);
}
.row div:nth-of-type(1) div {
background: hsla(133,50%,50%,.6);
}
</style>
</head>
<body>
<div class="demo">
<div class="row">
<div>
1
</div>
<div>
0.8
</div>
<div>
0.6
</div>
<div>
0.4
</div>
<div>
0.2
</div>
</div>
<div class="row">
<div>
1
</div>
<div>
0.8
</div>
<div>
0.6
</div>
<div>
0.4
</div>
<div>
0.2
</div>
</div>
<div class="row">
<div>
1
</div>
<div>
0.8
</div>
<div>
0.6
</div>
<div>
0.4
</div>
<div>
0.2
</div>
</div>
<div class="row">
<div>
1
</div>
<div>
0.8
</div>
<div>
0.6
</div>
<div>
0.4
</div>
<div>
0.2
</div>
</div>
<div class="row">
<div>
1
</div>
<div>
0.8
</div>
<div>
0.6
</div>
<div>
0.4
</div>
<div>
0.2
</div>
</div>
</div> </body>
</html>
CSS学习(十六)-HSLA颜色模式的更多相关文章
- 强化学习(十六) 深度确定性策略梯度(DDPG)
在强化学习(十五) A3C中,我们讨论了使用多线程的方法来解决Actor-Critic难收敛的问题,今天我们不使用多线程,而是使用和DDQN类似的方法:即经验回放和双网络的方法来改进Actor-Cri ...
- 设计模式学习笔记(十六)迭代器模式及其在Java 容器中的应用
迭代器(Iterator)模式,也叫做游标(Cursor)模式.我们知道,在Java 容器中,为了提高容器遍历的方便性,把遍历逻辑从不同类型的集合类中抽取出来,避免向外部暴露集合容器的内部结构. 一. ...
- Scala学习十六——XML处理
一.本章要点 XML字面量<like>this</like>的类型为NodeSeq 可以在XML字面量中内嵌Scala代码 Node的child属性产出后代节点 Node的at ...
- CSS学习笔记六:写原生导航栏
因为刚开始学习CSS时,只了解了一些基本样式,然后就跑去学习bootstrap.bootstrap是个不错的东西,挺好玩,起码让你写界面写的轻轻松松,几行引入代码,再来个复制粘贴就解决了,而且boot ...
- Salesforce LWC学习(十六) Validity 在form中的使用浅谈
本篇参考: https://developer.salesforce.com/docs/component-library/bundle/lightning-input/documentation h ...
- css学习の第六弹—样式设置小技巧
一.css样式设置小技巧>>1.行内元素水平居中是通过给父元素设置 text-align:center 来实现的.html代码:<body> <div class=&qu ...
- Spring学习(十六)----- Spring AOP实例(Pointcut(切点),Advisor)
在上一个Spring AOP通知的例子,一个类的整个方法被自动拦截.但在大多数情况下,可能只需要一种方式来拦截一个或两个方法,这就是为什么引入'切入点'的原因.它允许你通过它的方法名来拦截方法.另外, ...
- 设计模式(十六)迭代器模式 Iterator
什么时候需要用到迭代器模式? 有许多中方法,可以把对象堆起来放进一个集合(可以是数组.堆栈.列表.哈希表,等等). 每一种类型的集合,都有各自适用的时机.但是某个时间段,客户端可能希望去遍历这个集合. ...
- 设计模式(十六)Mediator模式
在实际的工作小组的交流过程是,组员向仲裁者报告,仲裁者向组员下达指示,组员之间不再互相询问和指示.Mediator模式是指,当发生麻烦事情的时候,通知仲裁者:当发生涉及全体组员的事情时,也通知仲裁者. ...
随机推荐
- gitlab克隆报错:remote: HTTP Basic: Access denied;remote: You must use a personal access token with ‘api’ scope for Git over HTTP.
错误: remote: HTTP Basic: Access denied remote: You must use a personal access token with ‘api’ scope ...
- 【NOIP2018】 游记
All ended? [day 0] 一点感觉没有,不过翘掉了早上的课(当然还有前三周的课),然后刚想睡一会儿,就被通知要上车了/难受 在车上玩了一会儿早上下的Super Mario(主要是早上刷了一 ...
- Windows7下caffe-ssd-microsoft下编译
整个编译可谓漫长 编译了两天 网上教程也很多 但是也很杂 遇到各种错误 总归是编完了 1.下载Windows版本的Caffe-SSD源码 下载链接:https://github.com/conner9 ...
- unicode、UTF-8、UTF-16的历史
1:中国人民通过对 ASCII 编码的中文扩充改造,产生了 GB2312 编码,可以表示6000多个常用汉字. 2:汉字实在是太多了,包括繁体和各种字符,于是产生了 GBK 编码,它包括了 GB231 ...
- Java 入门作业
- 【Oracle】append
我们在生产环境中经常遇到需要往表中插入大量数据的情况,怎么样才能让插入数据的速度变快呢?Oracle中的append简直就是神器!!没图说个**,直接上图: 是不是看晕了?哈哈,莫慌,请看下面总结: ...
- 查看SqlServer连接所使用的端口号
最近一个项目里用到了一个插件,在配置时发现连接数据库使用的是JDBC,输入URL时用到了端口号.印象中在使用Sqlserver时貌似没有提到端口号,在网上查阅了一下,记录下来省的忘了 方法是通过内置的 ...
- Python 之 %s字符串、%d整型、%f浮点型
%s string="hello" #%s打印时结果是hello print "string=%s" % string # output: string=hel ...
- C#:winform项目在win7,xp32位和64位都能运行
vs中项目配置管理器活动解决方案平台选择X86平台.
- Quartz+Topshelf 作业
小记: 引用Quartz.Topshelf.Topshelf.Quartz 使用方法: http://www.cnblogs.com/mushroom/p/4952461.html http://ww ...