The stroke-opacity property is used to set the opacity of the color or pattern that is applied to the stroke of a shape. A decimal or percentage value could be used to make the stroke visible, invisible or semi-transparent.
stroke-opacity: [0-1] | <percentage>
Parameters: This property accepts two types of parameters as mentioned above and described below:
- [0-1]: It is used to set the opacity in a decimal value from 0 to 1. A value of 0 would mean that the stroke is completely transparent and invisible. A value of 1 means that the stroke is fully opaque and visible. A decimal value between these values two would give a semi-transparent stroke.
- percentage: This is used to set the opacity in a percentage values. A value of 0% would mean that the stroke is completely transparent and invisible. A value of 100% means that the stroke is fully opaque and visible. A percentage value between these two values would give a semi-transparent stroke.
Below examples will illustrates the stroke-opacity property in CSS:
Example 1: This example uses a value 0 to 1 to set the stroke opacity.
Example 2: This example uses percentage value to set the stroke opacity.
Supported Browsers: The browsers supported by CSS stroke-opacity property are listed below:
- Internet Explorer 9
- CSS | transition-property Property
- CSS | nav-right property
- CSS | nav-down property
- CSS | all Property
- CSS | right Property
- CSS | top Property
- CSS | nav-up property
- CSS | border-right Property
- HTML | DOM li value Property
- CSS | clear Property
- CSS | The object-fit Property
- CSS | transform Property
- CSS | align-self Property
- CSS | shape-outside Property
- CSS | resize Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.