Structure

layout

We use a grid system built using Bootstrap 5. Bootstrap’s grid system uses a series of containers, rows, and columns to layout and align content. It’s built with flexbox and it's fully responsive.

Bootstrap's grid system divides the screen into 12 columns across the page. If you do not want to use all 12 column individually, you can group the columns together to create wider columns:

All the information can be found here: Bootstrap 5

How it works

Bootstrap’s grid system can adapt across all six default breakpoints, and any breakpoints you customize. The six default grid tiers are as follow:

  • Extra small (xs)
  • Small (sm)
  • Medium (md)
  • Large (lg)
  • Extra large (xl)
  • Extra extra large (xxl)

As noted above, each of these breakpoints have their own container, unique class prefix, and modifiers. Here’s how the grid changes across these breakpoints:

 xs
<576px
sm
≥576px
md
≥768px
lg
≥992px
xl
≥1200px
xxl
≥1400px
Container max-widthNone (auto)540px720px960px1140px1320px
Class prefix.col-.col-sm-.col-md-.col-lg-.col-xl-.col-xxl-
# of columns12
Gutter width1.5rem (.75rem on left and right)
Custom guttersYes
NestableYes
Column orderingYes

 

Breaking it down, here’s how the grid system comes together:

  • Our grid supports six responsive breakpoints. Breakpoints are based on min-width media queries, meaning they affect that breakpoint and all those above it (e.g., .col-sm-4 applies to smmdlgxl, and xxl). This means you can control container and column sizing and behavior by each breakpoint.

  • Containers center and horizontally pad your content. Use .container for a responsive pixel width, .container-fluid for width: 100% across all viewports and devices, or a responsive container (e.g., .container-md) for a combination of fluid and pixel widths.

  • Rows are wrappers for columns. Each column has horizontal padding (called a gutter) for controlling the space between them. This padding is then counteracted on the rows with negative margins to ensure the content in your columns is visually aligned down the left side. Rows also support modifier classes to uniformly apply column sizing and gutter classes to change the spacing of your content.

  • Columns are incredibly flexible. There are 12 template columns available per row, allowing you to create different combinations of elements that span any number of columns. Column classes indicate the number of template columns to span (e.g., col-4 spans four). widths are set in percentages so you always have the same relative sizing.

  • Gutters are also responsive and customizable. Gutter classes are available across all breakpoints, with all the same sizes as our margin and padding spacing. Change horizontal gutters with .gx-* classes, vertical gutters with .gy-*, or all gutters with .g-* classes. .g-0 is also available to remove gutters.

  • Sass variables, maps, and mixins power the grid. If you don’t want to use the predefined grid classes in Bootstrap, you can use our grid’s source Sass to create your own with more semantic markup. We also include some CSS custom properties to consume these Sass variables for even greater flexibility for you.

Be aware of the limitations and bugs around flexbox, like the inability to use some HTML elements as flex containers.

 

Creating a structure

Following this method, it'd be very easy for us to create the structure of the page. First, we decide if we want the columns to span full width or within a container. In this example, they will be wrapped by a container, so we start with:

<div class="container">

</div>

Then, we add the rows. Let's start with one row:

<div class="container">

    <div class="row">

    </div>

</div>

FInally, we add the number of columns we need (i.e 4 columns). Let's create the sctructure for these:

<div class="container">

    <div class="row">

        <div class="col col-3">First column</div>

        <div class="col col-3">Second column</div>

        <div class="col col-3">Third column</div>

        <div class="col col-3">Fourth column</div>

    </div>

</div>

*Remember that the sum of all the columns should be 12

More News

Scottish Rugby Varsity is BACK!
University ruby players from two teams standing together on the pitch in front of the goalposts and

The Scottish Rugby Varsity Match returns to HIVE Stadium on Friday 18 September as Edinburgh and St Andrews continue one of Scotland's oldest sporting rivalries. Discover the remarkable history behind the fixture, then secure your tickets and be part of the next chapter.READ MORE

Welcome to the Edinburgh Wildcats
Picture of the top of the back o fa green women's sports playing top with text in white saying Edinb

10,000 people. More than 200 teams. One University. One Identity. The Edinburgh Wildcats are built on ambition, belonging and belief. Inspired by the resilience, strength and determination of Scotland's native wildcat, our identity connects everyone from first-time participants to international atREAD MORE

Watch live sport on UoESport.tv
UoESport.tv logo

UoESport.tv is back — bigger, better and ready for another season. From live fixtures to unforgettable moments, catch more of Edinburgh University sport wherever you are. Don’t miss a moment — sign up for just 99p per month, tune in, and cheer on the Edinburgh Wildcats!READ MORE