To change opacity of Div using CSS, you can set the opacity
style property for the div elements with the values like 0.1
, 0.5
, 0.9
, etc.
The following is the typical CSS code to change opacity of Div in HTML page using tag name div
.
div {
opacity: 0.1;
}
div {
opacity: 0.5;
}
div {
opacity: 0.9;
}
We shall go through some working examples on how to change opacity of Div using CSS. In the following examples, you may change the value of opacity and Run the code to visually observe the changes made to the Div elements.
This is an example on how to change opacity of Div using 10% opacity.
You may edit the following code, and click on Run button.
This is an example on how to change opacity of Div using 50% opacity.
You may edit the following code, and click on Run button.
This is an example on how to change opacity of Div using 90% opacity.
You may edit the following code, and click on Run button.