Year 10TechnologySupport
All questions are about a website for a café. Read each piece of code carefully. Unless a question says otherwise, box-sizing is the default (content-box), so width sets the content area only.
ASelectors
A full stop means a class. A # means an id.
- 1.
Match each selector to what it styles.
(2 marks)- p
- .special
- #menu
- h2
- Athe one element with id="menu"
- Bevery paragraph
- Cevery level 2 heading
- Devery element with class="special"
- 2.
Which line links a stylesheet called cafe.css to an HTML page?
(1 mark)- <link rel="stylesheet" href="cafe.css">
- <style src="cafe.css">
- <css>cafe.css</css>
- <a href="cafe.css">
- 3.
Worked example: h1 { color: brown; } makes all h1 headings brown. Write a rule that makes every paragraph 18px.
(1 mark)
BThe box model
Content, then padding, then border, then margin.
- 4.
Match each part of the box model to its meaning.
(2 marks)- Padding
- Border
- Margin
- Athe line around the padding
- Bspace outside the border, between this box and others
- Cspace between the content and the border
- 5.
Worked example: a box with width: 200px and padding: 10px is 10 + 200 + 10 = 220px wide inside its border. A box has width: 300px and padding: 20px, with no border. How wide is it?
(1 mark) - 6.
Grey text (#999999) on a white background is easy for everyone to read.
(1 mark)- True
- False
- 7.
This rule does not work. Find the mistake and write it correctly. .special { colour: red; }
(1 mark)