Computer >> คอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

คุณสมบัติตัวแปรแบบอักษร CSS


คุณสมบัติ font-variant ใน CSS เป็นชวเลขสำหรับคุณสมบัติต่อไปนี้:font-variant-caps, font-variant-numeric, font-variant-alternates, font-variant-ligatures และ font-variant-east-asian มีค่าดังต่อไปนี้ −

font-variant: normal|small-caps|initial|inherit;

ตัวอย่าง

ให้เรามาดูตัวอย่างการใช้งานคุณสมบัติตัวแปรฟอนต์ -

<!DOCTYPE html>
<html>
<head>
<style>
body {
   background-image: linear-gradient(to right, yellow,orange,yellow,green,blue,indigo,violet);
}
.demo {
   text-decoration: overline;
   text-decoration-color: yellow;
   font-variant:normal;
}
</style>
</head>
<body>
<h1>Examination Details</h1>
<p class="demo">Exam on 20th December.</p>
<p class="demo2">Exam begins at 9AM.</p>
</body>
</html>

ผลลัพธ์

คุณสมบัติตัวแปรแบบอักษร CSS

ตัวอย่าง

เรามาดูตัวอย่างอื่นกัน −

<!DOCTYPE html>
<html>
<head>
<style>
.demo {
   text-decoration: overline underline;
   text-decoration-color: blue;
   font-variant: small-caps;
}
</style>
</head>
<body>
<h1>Details</h1>
<p class="demo">Examination Center near ABC College.</p>
<p class="demo2">Exam begins at 9AM.</p>
</body>
</html>

ผลลัพธ์

คุณสมบัติตัวแปรแบบอักษร CSS