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"
< 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"
< text xml:lang = "ar" >
مرØبا
</ text >
</ svg >
</ body >
</ html >
|
Output:
Last Updated :
10 Dec, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...