Open In App

SVG font-variant Attribute

The font-variant attribute indicates the variant in which the text or font is to be rendered.

Syntax:



font-variant = "variant"

Attribute Values:

We will use the font-variant attribute for setting the variation of the font.



Example 1: 




<!DOCTYPE html>
<html>
  
<body>
    <svg viewBox="0 0 250 30" 
        xmlns="http://www.w3.org/2000/svg">
          
        <text y="20" font-variant="Normal">
            GeeksforGeeks
        </text>
    </svg>
</body>
  
</html>

Output:

Example 2: 




<!DOCTYPE html>
<html>
  
<body>
    <svg viewBox="0 0 250 30" 
        xmlns="http://www.w3.org/2000/svg">
          
        <text x="10" y="20" font-variant="small-caps">
            GeeksforGeeks
        </text>
    </svg>
</body>
  
</html>

Output:


Article Tags :