ExamBank Scot · Higher Computing Science question bank · All Higher Computing Science questions
3 marks · CSS rules and selectors
A section of the CSS code for styling a website is shown below: main {background-color: red;} section {background-color: red; padding: 5px;} p {padding: 5px;} h1 {color: white; font-size: 22px; padding: 5px;} h2 {padding: 5px;} Use grouping selectors to re‑write the code to make it more efficient.
• main, section {background-color: red} • section, p, h1, h2 {padding: 5px} • h1 {color: white; font- size: 22px}
Previous question: Higher Computing Science 2024 Question 14