สไตล์พื้นหลังทรัพย์สินเดิม
ตัวอย่าง
วางตำแหน่งภาพพื้นหลังที่สัมพันธ์กับกล่องเนื้อหา:
document.getElementById("myDIV").style.backgroundOrigin = "content-box";
ความหมายและการใช้งาน
คุณสมบัติ backgroundOrigin ตั้งค่าหรือส่งคืนสิ่งที่คุณสมบัติตำแหน่งพื้นหลังสัมพันธ์กับ
หมายเหตุ:หากคุณสมบัติการแนบพื้นหลังสำหรับรูปภาพพื้นหลังเป็น "คงที่" คุณสมบัตินี้จะไม่มีผลใดๆ
รองรับเบราว์เซอร์
ตัวเลขในตารางระบุเบราว์เซอร์รุ่นแรกที่สนับสนุนคุณสมบัติอย่างสมบูรณ์
Property | |||||
---|---|---|---|---|---|
backgroundOrigin | 4.0 | 9.0 | 4.0 | 3.0 | 10.5 |
ไวยากรณ์
ส่งคืนคุณสมบัติ backgroundOrigin:
object.style.backgroundOrigin
ตั้งค่าคุณสมบัติ backgroundOrigin:
object.style.backgroundOrigin = "padding-box|border-box|content-box|initial|inherit"
มูลค่าทรัพย์สิน
Value | Description |
---|---|
padding-box | Default value. The background image is positioned relative to the padding box |
border-box | The background image is positioned relative to the border box |
content-box | The background image is positioned relative to the content box |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
รายละเอียดทางเทคนิค
ค่าเริ่มต้น: | padding-box |
---|---|
คืนมูลค่า: | สตริงที่แสดงถึงคุณสมบัติต้นกำเนิดพื้นหลังขององค์ประกอบ |
เวอร์ชัน CSS | CSS3 |
หน้าที่เกี่ยวข้อง
การอ้างอิง CSS: คุณสมบัติที่มาพื้นหลัง