สไตล์ข้อความคุณสมบัติ เงา
ตัวอย่าง
เพิ่มเงาให้กับข้อความ:
document.getElementById("demo").style.textShadow = "5px 5px 1px #ff0000, 10px 10px 1px #0000ff";
ความหมายและการใช้งาน
คุณสมบัติ textShadow ตั้งค่าหรือส่งคืนเอฟเฟกต์เงามากกว่าหนึ่งค่าสำหรับข้อความ
รองรับเบราว์เซอร์
Property | |||||
---|---|---|---|---|---|
textShadow | Yes | 10.0 | Yes | Yes | Yes |
ไวยากรณ์
ส่งคืนคุณสมบัติ textShadow:
object.style.textShadow
ตั้งค่าคุณสมบัติ textShadow:
object.style.textShadow = "none|h-shadow v-shadow blur color|initial|inherit"
หมายเหตุ:คุณสมบัติ textShadow แนบเงาอย่างน้อยหนึ่งเงากับข้อความ คุณสมบัตินี้เป็นรายการเงาที่คั่นด้วยเครื่องหมายจุลภาค โดยแต่ละรายการระบุด้วยค่าความยาว 2 หรือ 3 ค่าและสีที่ไม่บังคับ ความยาวที่ละเว้นคือ 0
มูลค่าทรัพย์สิน
Value | Description |
---|---|
none | No shadow is drawn. This is default |
h-shadow | Required. The position of the horizontal shadow. Negative values are allowed |
v-shadow | Required. The position of the vertical shadow. Negative values are allowed |
blur | Optional. The blur distance |
color | Optional. The color of the shadow. Look at CSS Color Values for a complete list of possible color values |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
รายละเอียดทางเทคนิค
ค่าเริ่มต้น: | ไม่มี |
---|---|
คืนมูลค่า: | สตริงที่แสดงรายการเอฟเฟกต์เงาที่คั่นด้วยเครื่องหมายจุลภาคที่ใช้กับข้อความขององค์ประกอบ |
เวอร์ชัน CSS | CSS3 |
ตัวอย่างเพิ่มเติม
ตัวอย่าง
กลับเงาข้อความ:
alert(document.getElementById("myP").style.textShadow);
หน้าที่เกี่ยวข้อง
กวดวิชา CSS: CSS3 เอฟเฟกต์ข้อความ
การอ้างอิง CSS: คุณสมบัติ text-shadow
❮ สไตล์วัตถุ