Search code examples
htmlcolorshtml5-canvasrgba

Html rgba color opacity?


When we use RGBA in Html we use sth like this.

<div style="Background: rgba (x, x, x, 0.dd)">Some Content</div>

How many decimals can you go in the dd(opacity). Is it browser dependent? Or are its limits specified in HTML standards?


Solution

  • The specification says it is a <number> which is defined as:

    zero or more digits followed by a dot (.) followed by one or more digits

    So there is no limit specified in the CSS spec.

    I'd be surprised if any human eye could distinguish beyond two decimal places though.