คุณสมบัติ text-stroke-width
คุณสมบัติ text-stroke-width กำหนดความหนาของเส้นขอบหรือโครงร่างของตัวอักษรข้อความ ค่าที่รับได้คือค่าที่ระบุในหน่วยวัด เช่น px, em, rem และอื่นๆ นอกจากนี้ยังสามารถกำหนดค่าได้ดังนี้: thin (เส้นบาง), medium (เส้นปานกลาง) และ thick (เส้นหนา)
โครงสร้าง
ตัวเลือก {
text-stroke-width: ตัวเลข หรือ thin หรือ medium หรือ thick;
}
ตัวอย่าง
มาทำให้ตัวอักษรข้อความของเรามีเส้นขอบบางกัน:
<p>
Text
</p>
body {
width: 100px;
height: 50px;
}
p {
-webkit-text-stroke-color: orange;
-webkit-text-stroke-width: thin;
text-stroke-width: thin;
color: white;
font-size: 10em;
margin-top: 0;
font-weight: bold;
font-family: Arial;
}
:
ตัวอย่าง
ทีนี้ลองเปลี่ยนเส้นขอบจากบางเป็นปานกลาง:
<p>
Text
</p>
body {
width: 100px;
height: 50px;
}
p {
-webkit-text-stroke-color: orange;
-webkit-text-stroke-width: medium;
text-stroke-width: medium;
color: white;
font-size: 10em;
margin-top: 0;
font-weight: bold;
font-family: Arial;
}
:
ตัวอย่าง
มาทำให้ตัวอักษรข้อความของเรามีเส้นขอบหนากัน:
<p>
Text
</p>
body {
width: 100px;
height: 50px;
}
p {
-webkit-text-stroke-color: orange;
-webkit-text-stroke-width: thick;
text-stroke-width: thick;
color: white;
font-size: 10em;
margin-top: 0;
font-weight: bold;
font-family: Arial;
}
:
ตัวอย่าง
นอกจากนี้ มาทำให้ตัวอักษรข้อความของเรามีเส้นขอบหนา 2px:
<p>
Text
</p>
body {
width: 100px;
height: 50px;
}
p {
-webkit-text-stroke-color: orange;
-webkit-text-stroke-width: 2px;
color: white;
font-size: 10em;
margin-top: 0;
font-weight: bold;
font-family: Arial;
}
:
ดูเพิ่มเติม
-
คุณสมบัติ
text-stroke,
ซึ่งกำหนดเส้นขอบข้อความ -
คุณสมบัติ
text-stroke-color,
ซึ่งกำหนดสีให้กับเส้นขอบข้อความ