民國109年 第2梯次 網頁設計丙級 學科
第45題
何種CSS 語法可使網頁捲動時,背景圖案會跟著移動?
題目
何種CSS 語法可使網頁捲動時,背景圖案會跟著移動?
- (1) {background-attachment: scroll;}
- (2) {backgr ound-repeat: repeat;}
- (3) {background-image: scroll;}
- (4) {background-attachment: move;}
官方答案
(1) {background-attachment: scroll;}
解析
CSS background-attachment 屬性控制背景圖是否隨頁面捲動。scroll 值表示背景圖隨內容一起捲動(預設行為);fixed 則固定在視窗。選項2 background-repeat 控制重複方式,選項3 background-image 無 scroll 值,選項4 move 非標準屬性值。
AI 參考解析(推得答案已與官方答案比對一致),非官方公告內容,僅供備考參考。