Tệp đính kèm nền CSS
Đính kèm nền CSS
Thuộc tính background-attachment
chỉ định xem hình nền sẽ cuộn hay được cố định (sẽ không cuộn với phần còn lại của trang):
Ví dụ
Chỉ định rằng hình nền cần được sửa:
body
{
background-image: url("img_tree.png");
background-repeat: no-repeat;
background-position: right top;
background-attachment: fixed;
}
Hãy tự mình thử »Ví dụ
Chỉ định rằng hình nền sẽ cuộn theo phần còn lại của trang:
body
{
background-image: url("img_tree.png");
background-repeat: no-repeat;
background-position: right top;
background-attachment: scroll;
}
Hãy tự mình thử »Thuộc tính đính kèm nền CSS
Property | Description |
---|---|
background-attachment | Sets whether a background image is fixed or scrolls with the rest of the page |