คุณสมบัติ font-style
เพื่อทำให้ฟอนต์เป็นตัวเอียง ให้ใช้คุณสมบัติ font-style
ตัวอย่าง
ลองรันโค้ดต่อไปนี้เพื่อเรียนรู้การทำงานของคุณสมบัติ font-style:
<html>
<head>
</head>
<body>
<p style="font-style:italic;">
This text is in italic style </p>
</body>
</html>
ค่าที่ใช้ได้:
- normal - ปกติ (ค่าเริ่มต้น)
- italic - ตัวเอียง (ใช้ฟอนต์ italic จริงถ้ามี)
- oblique - ตัวเอียงแบบเงียง (slanted version ของฟอนต์ปกติ)
ความแตกต่าง: italic ใช้ glyph ที่ออกแบบมาสำหรับตัวเอียง ส่วน oblique แค่เงียง glyph ปกติ