CSS font-variant-ligatures Property

The CSS font-variant-ligatures property is used for controlling ligatures on a text’s font. A ligature is a special character that combines two or more characters into one. Ligatures are commonly used to give certain style or look to the text.

Syntax:

font-variant-ligatures: Keyword_values

Or

 font-variant-ligatures: Global_values 

Property values: This property accepts property values mentioned above and described below.

  • Keyword_values: This property value refers to the values defined by “normal”, “none”, “common-ligatures”, “no-common-ligatures”, “discretionary-ligatures”, “no-discretionary-ligatures”, “historical-ligatures”, “no-historical-ligatures”, “contextual”, “no-contextual”.
  • Global_values: This property value refers to the values defined by “inherit”, “initial”, “unset”.

Example 1: Below is the example that illustrates the use of font-variant-ligatures property using common-ligatures and no-common-ligatures.



HTML

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html lang="en">
  
<head>
    <style>
        div {
            font-size: 5vw;
        }
  
        .off {
            font-variant-ligatures: no-common-ligatures;
            color: rgb(83, 241, 21);
        }
  
        .on {
            font-variant-ligatures: common-ligatures;
            color: rgb(96, 153, 4);
        }
    </style>
</head>
  
<body>
    <h1 style="color: green;">GeeksforGeeks</h1>
    <div>
        <span class="off">wifi</span>
        <span class="on">wifi</span>
    </div>
</body>
  
</html>

chevron_right


Output:

Supported Browsers:

  • Chrome
  • Firefox
  • Safari
  • Opera
  • Edge
  • Internet Explorer (Not Supported).
My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.