All subjects · Information Technology · WIT12 3 hour practical exam on web development with HTML, CSS and JavaScript

Layouts for different screen sizes and responsive design

Edexcel IAL Information Technology · WIT12 3 hour practical exam on web development with HTML, CSS and JavaScript

Pages are viewed on phones, tablets, desktops and even games consoles. You need fixed-width, liquid and grid layouts, CSS frameworks, and responsive design with media queries (spec 8.3.3 and 8.3.4). A 20-mark exam question usually asks for a responsive page.

Practise this in the app: instant marking and a fix for every mistake. Free, no email needed to start.

Practise this lesson

Fixed-width, liquid and grids (8.3.3)

LayoutHowStrengthsWeaknesses
Fixed-widthWidths in pixels, for example a 960px containerPrecise control; looks the same on every desktopHorizontal scrolling on small screens; wasted space on large ones
Liquid (fluid)Widths in percentagesFills any window widthLines become too long on wide screens and columns too narrow on phones
ResponsiveFluid widths plus media queries that change the layout at breakpointsSuits every deviceMore design, coding and testing

Layout grids, flexbox and frameworks

A layout grid divides the page into columns (often 12) so elements line up. CSS can build grids with flexbox or grid:

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.col {
  flex: 1;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

A CSS framework (such as Bootstrap) is a ready-made style sheet with a grid and styled components, used by adding its class names. It speeds up development because the CSS does not have to be written from scratch, and it is tested across browsers. Drawbacks: large files, sites that look alike, and classes to learn. Pearson's 2025 report noted candidates confusing a framework with their own reusable style sheets.

Media queries (8.3.4)

A media query applies rules only when a condition is true, usually a screen width. The breakpoint is the width where the layout changes.

/* mobile first: one column by default */
img {
  width: 100%;
  height: auto;
}
/* 600px and wider: images float beside the text */
@media (min-width: 600px) {
  img {
    width: 40%;
    float: right;
  }
}
/* narrower than 600px: smaller headings */
@media (max-width: 599px) {
  h1 {
    font-size: 1.5em;
  }
}

Responsive techniques: the viewport meta tag; relative units (%, em, rem, vw); flexible images (max-width: 100%); flexbox or grid that wrap; media queries; navigation that collapses into a menu button on small screens; and a mobile-first approach (style the small screen first, then add min-width queries).

What counts as responsive in the exam

Pearson's examiners have stated that making two separate pages or style sheets for different widths is not responsive, and a page that only matches the design at one width is not responsive either. One page and one style sheet must change as the window is resized. Test by dragging the browser window narrower and wider (or using the browser's device toolbar) and check every requirement at each width.

Worked example

The design says: at screen widths below 600px the navigation links stack vertically and images are 100% wide; at 600px and above the links sit in a row. Write the CSS.

  1. Mobile first: default rules for small screens (links as blocks, images 100% wide).
  2. At 600px and above, a min-width: 600px query puts the links in a row.

Answer: ```css nav a { display: block; } img { width: 100%; } @media (min-width: 600px) { nav a { display: inline-block; } img { width: auto; } } ```

Key idea: Fixed-width layouts use pixels, liquid layouts use percentages, responsive layouts add media queries at breakpoints. Grids, flexbox and frameworks line content up. One page, one style sheet, adapting to the width: that is responsive.

Check yourself

  1. Which layout sets widths in percentages so the page stretches to fill any window?
    • Fixed-width
    • Liquid
    • Absolute
    • Static
    Show answer

    Liquid. Liquid (fluid) layouts use relative widths.

  2. Which media query applies its rules only when the window is 768px wide or narrower?
    • `@media (min-width: 768px)`
    • `@media (width > 768px)`
    • `@media screen and (min-width: 769px)`
    • `@media (max-width: 768px)`
    Show answer

    `@media (max-width: 768px)`. max-width: 768px means 'up to and including 768px wide'.

  3. A candidate makes mobile.html and desktop.html with separate style sheets. Why did examiners say this is not a responsive design?
    • Responsive pages must not use media queries
    • A responsive design is one page that adapts its layout to the screen width
    • Two pages always load more slowly
    • Responsive pages must use a CSS framework
    Show answer

    A responsive design is one page that adapts its layout to the screen width. Responsive design means a single page adapting with fluid layouts and media queries.

  4. Give one advantage of using a CSS framework when building a website.
    Show answer

    It speeds up development because the grid and styles are already written and tested, so the CSS does not need to be written from scratch.. Frameworks save development time, are tested across browsers, give a consistent look and include responsive grids.

  5. What is the main problem with a fixed 1000px-wide layout on a 375px-wide phone screen?
    • The user must scroll sideways or zoom to read it
    • The text becomes too large
    • Images will not load
    • Links stop working
    Show answer

    The user must scroll sideways or zoom to read it. A fixed layout does not shrink, so it overflows the small screen.

  6. Which rule stops images overflowing small screens while keeping their proportions?
    • img { width: 1000px; }
    • img { height: 100%; width: 300px; }
    • img { max-width: 100%; height: auto; }
    • img { float: none; height: 50px; }
    Show answer

    img { max-width: 100%; height: auto; }. max-width: 100% limits the width to the container; height: auto keeps the aspect ratio.

  7. In a mobile-first style sheet, which kind of media query is mainly used to add rules for larger screens?
    • min-width
    • max-width
    • orientation: portrait
    • print
    Show answer

    min-width. Mobile first styles small screens by default, then adds min-width queries as the screen gets wider.

  8. Which value of the display property turns a container into a flexible box whose children sit in a row and can wrap? Type the value.
    Show answer

    flex. display: flex creates a flex container; with flex-wrap: wrap its items wrap onto new lines.

Practise with instant feedback

Sources

Last updated 8 November 2026. Spotted a mistake? Tell us.