<style type="text/css"> body { background-color: #ff00004d; background-color: hsla(0, 100%, 50%, 0.3); background-color: rgba(255, 0, 0, 0.3); } </style>
我们大家对第一种很熟悉,是采用16位的格式书写,其中#ff00004d的前6位是颜色值,后两位则是透明的百分比,当然也是16进位的。
如果我们对16进位的数字不敏感,也可以选择后两种,hsl和rgb的方式,最后一位都是透明度的值。
必须登录才可以留言哦!