ไฟล์แนบพื้นหลัง CSS
ไฟล์แนบพื้นหลัง CSS
คุณสมบัติbackground-attachment
ระบุว่าภาพพื้นหลังควรเลื่อนหรือแก้ไข (จะไม่เลื่อนกับส่วนที่เหลือของหน้า):
ตัวอย่าง
ระบุว่าควรแก้ไขภาพพื้นหลัง:
body
{
background-image: url("img_tree.png");
background-repeat: no-repeat;
background-position: right top;
background-attachment: fixed;
}
ตัวอย่าง
ระบุว่าภาพพื้นหลังควรเลื่อนไปพร้อมกับส่วนที่เหลือของหน้า:
body
{
background-image: url("img_tree.png");
background-repeat: no-repeat;
background-position: right top;
background-attachment: scroll;
}