VOOZH about

URL: https://www.geeksforgeeks.org/html/svg-opacity-attribute/

⇱ SVG opacity Attribute - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

SVG opacity Attribute

Last Updated : 31 Mar, 2022

The opacity attribute specifies the transparency of an object or of a group of objects.

Syntax:

opacity= "opacity"

Attribute Values:

  • decimal: The decimal at which we want to make our element opaque

We will use the opacity attribute for setting the opacity of the element.

Example 1: In this example we will use the opacity attribute for setting the opacity of circle element.

Output:

👁 Image

Example 2: In this example we will use the opacity attribute for setting the opacity of rectangle element.

Output:

👁 Image
Comment