VOOZH about

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

⇱ SVG visibility Attribute - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

SVG visibility Attribute

Last Updated : 31 Mar, 2022

The visibility attribute allows you to control the visibility of graphical elements. It has effect only on the following elements <a>, <altGlyph>, <audio>, <canvas>, <circle>, <ellipse>, <foreignObject>, <iframe>, <image>, <line>, <path>, <polygon>, <polyline>, <rect>, <text>, <textPath>, <tref>, <tspan>, <video>

Syntax:

visibility = visible | hidden | collapse

Attribute Values: The visibility attribute accepts the values mentioned above and described below

  • visible: This value indicates that the element will be visible.
  • hidden: This value indicates that the element will not be visible.
  • collapse: This value is equivalent to hidden.

Example 1: Below is the example that illustrates the use of the visibility attribute.

Output:

👁 Image

Example 2: Below is the example that illustrates the use of the visibility attribute.

Output:

👁 Image
Comment