font-variant प्रॉपर्टी का उपयोग font-variant-caps, font-variant-numeric, font-variant-alternates, font-variant-ligatures, और font-variant-east-asian को स्पेसिफाई करने के लिए किया जाता है।
सिंटैक्स
font-variant प्रॉपर्टी का सिंटैक्स निम्नलिखित है:
Selector { font-variant: /*value*/ }निम्नलिखित उदाहरण CSS font-variant प्रॉपर्टी को दर्शाते हैं:
उदाहरण
<!DOCTYPE html> <html> <head> <style> table * { box-shadow: inset 0 0 10px lavender; font-size: 1.2em; font-variant: small-caps; } td + td { font-variant: all-petite-caps; } </style> </head> <body> <table> <tr> <th>DEMO a</th> <th>DEMO b</th> </tr> <tr> <td>1a</td> <td>1b</td> </tr> <tr> <td>2a</td> <td>2b</td> </tr> </table> </body> </html>आउटपुट
यह निम्नलिखित आउटपुट देता है:

उदाहरण
<!DOCTYPE html> <html> <head> <style> div { display: flex; margin: 20px; width: 20%; float: left; box-shadow: inset 0 0 9px orange; } #demo { font-variant: unicase; } </style> </head> <body> <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed pellentesque felis ac lorem ornare maximus.</div> <div id="demo">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed pellentesque felis ac lorem ornare maximus.</div> </body> </html>आउटपुट
यह निम्नलिखित आउटपुट देता है:
