Full Marks

A-level Computer Science Year 12 · Topic 16

Web technologies

Web technologies explains how web pages are built, processed and found.

We will use H T M L, C S S and JavaScript, and compare client side and server side processing.

Then we see how search engines index the web, and how the PageRank algorithm ranks pages.

In this topic

  1. 16.1HTML, CSS and JavaScriptFree below · 28 questions
  2. 16.2Client-side and server-side processingOpen in Full Marks · 24 questions
  3. 16.3Search engine indexing and the PageRank algorithmOpen in Full Marks · 28 questions

16.1 · Free notes

HTML, CSS and JavaScript

Diagram: HTML, CSS and JavaScript

Key points

In more detail

Practice

HTML, CSS and JavaScript: 10 questions

Pick an answer to check it, or open the answer for the explanation.

1. Which technology defines the structure and content of a web page?

  1. HTML
  2. CSS
  3. HTTP
  4. JavaScript
Show answer

A: HTML. HTML uses tags and elements to define headings, paragraphs, links, images and forms. CSS handles presentation and JavaScript handles behaviour. HTTP is a transfer protocol, not a page language.

2. A developer wants to change the heading colour on all 50 pages of a site by editing a single file. Which is best?

  1. Inline style attributes on each heading
  2. <b> tags around each heading
  3. A <script> block on each page
  4. An external CSS stylesheet linked from every page
Show answer

D: An external CSS stylesheet linked from every page. An external stylesheet linked from every page means one edit changes all pages. Inline styles would need 50 separate edits and script blocks are not for styling.

3. style.css has h1 {color: blue;} but a page contains <h1 style="color:red">. What colour is that heading?

  1. Blue
  2. Black
  3. Purple
  4. Red
Show answer

D: Red. Inline styles have higher specificity than rules in an external stylesheet, so the inline red overrides the blue.

4. What does document.getElementById("total").innerHTML = "£5"; do?

  1. Applies a CSS rule to every element
  2. Creates a new HTML file called total
  3. Sends £5 to the server to be stored
  4. Changes the content of the element with id total in the DOM
Show answer

D: Changes the content of the element with id total in the DOM. It uses the DOM to find the element with id "total" and replaces its content, without reloading the page. It does not contact the server.

5. Which HTML attribute supplies text to show if an image cannot be displayed?

  1. alt
  2. title
  3. href
  4. src
Show answer

A: alt. The alt attribute holds alternative text for when the image fails to load and for screen readers. src is the image location and href is a link destination.

6. Which statement about JavaScript in a web page is correct?

  1. It can run in response to events such as a button click
  2. It is used to create database tables
  3. It must be compiled to machine code before download
  4. It only defines the layout of the page
Show answer

A: It can run in response to events such as a button click. JavaScript is event-driven and is normally interpreted by the browser. Layout is CSS, and database tables are created on a server.

7. A form uses method="get" to submit a search term. Where is the data sent?

  1. In the URL as a query string
  2. Only inside an encrypted body
  3. Inside the CSS file
  4. Directly into the database
Show answer

A: In the URL as a query string. GET appends the form data to the URL, so it is visible and can be bookmarked. POST puts it in the request body. Neither method encrypts data by itself.

8. Which HTML correctly makes a table row containing two data cells?

  1. <row> containing two <cell>
  2. <td> containing two <tr>
  3. <th> containing two <table>
  4. <tr> containing two <td>
Show answer

D: <tr> containing two <td>. <tr> is a table row and <td> is a table data cell, so a row contains cells. <row> and <cell> are not HTML elements.

9. Why is separating CSS from HTML considered good practice?

  1. It encrypts the HTML
  2. It stops JavaScript being used
  3. It lets presentation change without altering content
  4. It lets pages load without a server
Show answer

C: It lets presentation change without altering content. Separating content and style means the look can be changed in one place without editing the page content, which improves maintainability, consistency and accessibility.

10. Which HTML attribute is used to run JavaScript when a user clicks a button?

  1. class
  2. href
  3. action
  4. onclick
Show answer

D: onclick. onclick is an event handler attribute that runs a script when the element is clicked. action is for forms, href for links and class for CSS targeting.

Keep going in Full Marks

Full Marks has 28 questions on HTML, CSS and JavaScript (18 more than here), set out in practice levels. You also get notes and 3D models for all 3 subtopics of Web technologies, plus games, timed exams and past papers.

On your exam board

Not in the AQA and Cambridge specifications.

All A-level Computer Science Year 12 topics