คุณสมบัติ font-size
คุณสมบัติ font-size ใช้เพิ่มหรือลดขนาดฟอนต์ ใช้ควบคุมขนาดของฟอนต์ ค่าที่เป็นไปได้: xx-small, x-small, small, medium, large, x-large, xx-large, smaller, larger, ขนาดในพิกเซล หรือเปอร์เซ็นต์
<html>
<head>
</head>
<body>
<p style="font-size:15px;">This font size is 15 pixels</p>
<p style="font-size:small;">This font size is small</p>
<p style="font-size:large;">This font size is large</p>
</body>
</html>
หน่วยวัดที่ใช้ได้:
- Absolute: px, pt, pc, in, cm, mm
- Relative: em, rem, %, vw, vh, vmin, vmax
- Keyword: xx-small ถึง xx-large, smaller, larger
แนะนำ: ใช้ rem สำหรับขนาดหลัก ใช้ em สำหรับขนาดสัมพัทธ์กับพาเรนต์