Write CSS to make all elements with class 'note' blue.
- Select the class with a dot.
- .note { color: blue; }
Answer .note { color: blue; }
A-level Computer Science revision · Exchanging data
HTML structures web content with tags such as <h1>, <p>, <a>, <img>, <div> and <form>. CSS styles it using selectors, classes (.name) and identifiers (#name). JavaScript adds interactivity in the browser, such as validating forms before they are sent.
Watch out Client-side validation can be bypassed, so the server must validate too.
Write CSS to make all elements with class 'note' blue.
Answer .note { color: blue; }
Which HTML tag creates a hyperlink?
Which CSS selector targets an element with id 'main'?
Give one reason for using JavaScript to validate a form before submission.
Answer It gives instant feedback to the user and reduces load on the server by catching errors before data is sent.
A-level Computer Science Pro, OCR H446
£119 once
Price rises to £199 on 1 January. Save £80 by joining before then.
At least 12 months of access
No VAT is charged.