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
- How to override the CSS properties of a class using another CSS class ?
- Difference between bootstrap.css and bootstrap-theme.css
- CSS | table-layout Property
- CSS | text-align Property
- CSS | border-top-width Property
- CSS | isolation Property
- CSS | border-inline-start-style Property
- CSS | column-rule-width Property
- CSS | word-spacing Property
- CSS | animation-delay Property
- CSS | margin-top Property
- CSS | border radius property
- CSS | grid Property
- CSS | font-size-adjust Property
- CSS | visibility Property
- CSS | Display property
- CSS | grid-template-columns Property
- CSS | height Property
- CSS | transform-origin 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.