Skip to content
Related Articles

Related Articles

Improve Article

SVG xml:lang Attribute

  • Last Updated : 10 Dec, 2020

The xml:lang attribute in SVG is used to indicate the primary language that is used in the contents and attributes containing text content on the website. It is allowed in all XML dialects as it is a universal attribute. All elements use this attribute.

Syntax:

xml:lang = "language-tag"

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

  • language-tag: This value indicates the language used for the given element. The language is defined according to the BCP 47 specification.

Example 1:

HTML




<!DOCTYPE html>
<html>
  
<body>
    <h1 style="color: green; 
            margin-left: 80px;">
        GeeksforGeeks
    </h1>
  
    <svg viewBox="-5 -20 800 100" 
        xmlns="http://www.w3.org/2000/svg">
          
        <text xml:lang="en-US">
            It is a Computer
            Science portal.
        </text>
    </svg>
</body>
  
</html>

Output:



Example 2:

HTML




<!DOCTYPE html>
<html>
  
<body>
    <h1 style="color: green; 
            margin-left: 100px;
            font-size: 30px;">
        GeeksforGeeks
    </h1>
      
    <svg viewBox="20 -10 200 100" 
        xmlns="http://www.w3.org/2000/svg">
        <text xml:lang="ar">
            مرحبا
        </text>
    </svg>
</body>
  
</html>

Output:

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.




My Personal Notes arrow_drop_up
Recommended Articles
Page :