CSS基礎 練習問題 3:CSS複数プロパティの指定
複数のプロパティを組み合わせて、背景色を青、テキスト色を白に設定したい場合、正しいCSSの書き方はどれですか?
- background-color: blue; color: white;
- background: blue; text: white;
- color: white blue;
- bg: blue; text: white;
- background: blue white;
Qraftユーザーの成績:正答率 100%(14/14回正解)
正解と解説を見る
正解:background-color: blue; color: white;
異なるプロパティを複数指定する場合は、各プロパティを個別に記述します。`background-color: blue;`と`color: white;`のように、セミコロンで区切って記述します。