不透明性是较薄的油漆,需要添加黑色以增加不透明性。
以下示例显示CSS3 Opacity属性-
<html> <head> <style> #m1 {background-color:rgb(255,0,0);opacity:0.6;} #m2 {background-color:rgb(0,255,0);opacity:0.6;} #m3 {background-color:rgb(0,0,255);opacity:0.6;} </style> </head> <body> <p>HSLA colors:</p> <p id = "m1">Red</p> <p id = "m2">Green</p> <p id = "m3">Blue</p> </body> </html>