HSLA permette di aggiungere un quarto valore ad i colori HSL, che definisce l’opacità del colore.
Ecco un esempio:
Ed il CSS utilizzato nel primo caso è:
background-color: hsla(0,100%,50%,0.2);
background-color: hsla(0,100%,50%,0.4);
background-color: hsla(0,100%,50%,0.6);
background-color: hsla(0,100%,50%,0.8);
background-color: hsla(0,100%,50%,1);
background-color: hsla(0,100%,50%,0.4);
background-color: hsla(0,100%,50%,0.6);
background-color: hsla(0,100%,50%,0.8);
background-color: hsla(0,100%,50%,1);
Mentre nel secondo caso lo stesso risultato è ottenuto con valori RGB:
background-color: rgb(243,191,189);
background-color: rgb(246,143,142);
background-color: rgb(249,95,94);
background-color: rgb(252,47,47);
background-color: rgb(255,0,0);
background-color: rgb(246,143,142);
background-color: rgb(249,95,94);
background-color: rgb(252,47,47);
background-color: rgb(255,0,0);
Tag: css3, w3c, Web Design
