ExamBank Scot · Higher Computing Science question bank · All Higher Computing Science questions

Higher Computing Science 2021 Question 15

3 marks · CSS rules and selectors

Some CSS properties for a website are implemented/coded as follows. header {margin-right:10px; margin-left:10px;} nav {margin-right:10px; margin-left:10px;} #event {width:700px; margin-left:10px;} #gaminglogo {width:75px; height: 75px; float:right; margin-right: 20px;} #eventlogo {float:right; width:75px; height:75px; margin-right:20px;} #floorplan {margin-left:10px; width:700px;} footer {margin-left:10px; margin-right:10px;} Using grouping selectors to remove any repetition, re‑write the code to make it more efficient.

Marking scheme

• Grouping of floorplan and event to width 700px • Grouping gaminglogo and eventlogo to width/height 75 px, float right and margin-right 20 px • Implementing the 10 px margins in any of the grouping selectors 1 mark for each bullet Example answers: Header,nav,footer { margin- left 10px;margin-right: 10px;} #gaminglogo,eventlogo { width: 75px; height: 75px; float:right; margin-right: 20px;} #event,#floorplans {width: 700px; margin-left: 10px; } OR Header, nav, footer{margin- right:10px} Header, #event, footer, nav, #floorplan{margin- left:10px} #gaminglogo, #eventlogo{width:75px; height:75px; float:right; margin-right:20px} #floorplan, #event{Width:700px}

Previous question: Higher Computing Science 2021 Question 14

Next question: Higher Computing Science 2021 Question 16