Q94.
CSS 屬性何者可設定英文字首為大寫?
網頁設計 · 乙級 · 應用軟體安裝及使用 · Q94
難易度分析
2 / 5
本題考查對 CSS 文字格式化屬性定義的精確記憶,需能區分縮排、裝飾線與大小寫轉換等不同功能的屬性名稱,屬於基礎概念的辨析題目。
正確答案:②text-transform: capitalize;
② text-transform: capitalize;:text-transform: capitalize; 可將每個英文單字的首字母轉為大寫,其餘字母保持原樣,這是 CSS 標準的文字轉換屬性。
錯誤選項解析
- ① text-indent: capitalize;:text-indent 的功能是設定段落首行縮排的距離(如 px、em 單位),與文字大小寫轉換無關,不支援 capitalize 值。
- ③ text-decoration: capitalize;:text-decoration 用於設定文字裝飾效果(如 underline、line-through、overline),其有效值不包含 capitalize,此為屬性功能混淆。
- ④ CSS 無法做到:CSS 確實可以透過 text-transform 屬性實現大小寫轉換,除 capitalize 外還支援 uppercase(全大寫)與 lowercase(全小寫)。
Learning Tip
"本題常考陷阱為混淆 text-indent(縮排)、text-decoration(裝飾線)與 text-transform(大小寫轉換)的功能差異。實務上需注意 capitalize 僅將每個單字首字母大寫,若需全部轉大寫應使用 uppercase。"
學員答題分佈
①text-indent: capitalize;0%
②text-transform: capitalize;0%
③text-decoration: capitalize;0%
④CSS 無法做到0%
此答題分佈是根據學員在 LongePass 模擬考等實際作答紀錄計算而成。與考友分享這道歷屆試題與詳細解析!