VOOZH about

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

⇱ SVG patternUnits Attribute - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

SVG patternUnits Attribute

Last Updated : 31 Mar, 2022

The patternUnits attribute specifies that which coordinate system must be used for the geometry properties of the <pattern> element. Only <pattern> element is using this attribute.

Syntax:

patternUnits = userSpaceOnUse | objectBoundingBox

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

  • userSpaceOnUse: It shows that when the pattern was applied then all coordinates for the geometry properties refer to the user coordinate system.
  • objectBoundingBox: It shows that all coordinates for the geometry properties represent percentages or fractions of the bounding box of the element.

Below examples illustrate the use of patternUnits attribute.

Example 1:

Output:

👁 Image

Example 2:

Output:

👁 Image
Comment