Layouts
Structure your page content and elements.
Screen size
Most visitors to our websites use a mobile device, so we should design for small screens first, starting with a single-column layout.
Never make assumptions about what devices people are using. Design for different screen sizes rather than specific devices.
The default maximum page width is 1200px, but you can make it wider if your content requires it.
Responsive breakpoints
- mobile: 320px
- mobile large: 576px
- tablet: 641px
- desktop: 768px
- large desktop: 992px
The size of fonts and spacing rules change at the ‘Tablet’ breakpoint. On viewports up to 640px width, we use the small set of font sizes and spacing rules. On viewports that are greater than 641px, we use the large set of font sizes and spacing rules.
Common layouts
We recommend using either a 'two-thirds' or ‘two-thirds and one-third’ layout. That stops lines of text from getting so long that the page becomes difficult to read on desktop devices. This would usually mean no more than 75 characters per line.
Your main content should always be in a two-thirds column even if you’re not using a corresponding one-third column for secondary content.
These styles are the same as the GOV.UK Design System common layouts.
Understanding the grid system
The grid is structured with a govuk-grid-row wrapper which acts as a row to contain your grid columns.
You can add columns inside this wrapper to create your layout. To define your columns add the class beginning with govuk-grid-column- to a new container followed by the width, for example govuk-grid-column-one-third to apply your desired width.
The available widths are:
Full width
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<p>govuk-grid-column-full</p>
</div>
</div>
One-half
<div class="govuk-grid-row">
<div class="govuk-grid-column-one-half">
<p>govuk-grid-column-one-half</p>
</div>
</div>
One-third
<div class="govuk-grid-row">
<div class="govuk-grid-column-one-third">
<p>govuk-grid-column-one-third</p>
</div>
</div>
Two-thirds
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<p>govuk-grid-column-two-thirds</p>
</div>
</div>
One-quarter
<<div class="govuk-grid-row">
<div class="govuk-grid-column-one-quarter">
<p>govuk-grid-column-one-quarter</p>
</div>
</div>
Three-quarters
<div class="govuk-grid-row">
<div class="govuk-grid-column-three-quarters">
<p>govuk-grid-column-three-quarters</p>
</div>
</div>
Nested grids
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<p>govuk-grid-column-two-thirds</p>
<div class="govuk-grid-row">
<div class="govuk-grid-column-one-half">
<p>govuk-grid-column-one-half</p>
</div>
<div class="govuk-grid-column-one-half">
<p>govuk-grid-column-one-half</p>
</div>
</div>
</div>
</div>
Width override classes
If you need to constrain the width of an element independently of the grid system, you can use width override classes.
The width override classes start with govuk-!-width-, followed by the width on larger screen sizes. For example, govuk-!-width-one-half will apply a width of 50% and govuk-!-width-two-thirdswill apply a width of 66.66%.
Override how elements display
You can use display override classes if you need to override how elements display on the page.
Use:
govuk-!-display-blockto display as a blockgovuk-!-display-inlineto display inlinegovuk-!-display-inline-blockto display as an inline blockgovuk-!-display-noneto remove the element from the page
You can also remove elements from the printed version of the page using govuk-!-display-none-print.
Hide elements and keep them accessible to screen readers
You can stop elements from being displayed on the page and keep their contents available to screen readers using govuk-visually-hidden. You can use this to present content to screen reader users that sighted users do not need.
If the element is focusable, such as a link, you can make it become visible when receiving keyboard focus using govuk-visually-hidden-focusable.