The property corresponding to transparency in CSS is opacity.
The value of the opacity property can be set from 0.0 to 1.0. The smaller the value, the more transparent.
Demo:
- opacity: 0.4; <div style="width: 200px; height: 200px; border: 1px solid black;">
<div style="width: 100px; height: 100px; opacity: 0.4; background-color: blue;"></div>
</div>
- opacity: 1;
<div style="width: 200px; height: 200px; border: 1px solid black;">
<div style="width: 100px; height: 100px; opacity: 1; background-color: blue;"></div>
</div>
Or you could use RGBA as the background-color's value.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.