At the end of this Tutorial you will be able to:
You can view a finished version of the Bootstrap grid layout web page you will create in this Tutorial by clicking the link below. The finished web page will open in a new tab of your web browser.
bootstrap-practical-layouts.htmlAbout ‘whitespace’ in web page layout
Creating your Bootstrap layout web page
Adding visual guides to your web page
Downloading the custom stylesheet
Linking to the custom CSS file
Adding background colours to grid columns
Adding background colours to grid rows
Adding images to grid rows and columns
Removing the red-coloured border guides
The term white space comes from the world of print design where content - text and images - are (mostly) printed on white-coloured paper. White space means space in a design layout that is empty. Although it contains nothing, white space is just as important as any of the content it surrounds for this reason: it makes text more inviting to read.
Here are some examples of white space in use in print design.
As in print, so too in web design.
Because electronic screens - and modern printing processes - can create almost any background colour, the original term of white space is increasingly known by the alternative term of negative space.
In this Tutorial you will use a new stylesheet named bootstrap-custom.css that adjusts the Bootstrap grid so that it is more suited to creating web page layouts with whitespacing.
Let’s create a Bootstrap-based web page for working with multi-column layout grids. Here are the steps:
This new web page is located within your folder structure as shown below.
You will need some sample images to work with. Right-click on the images below, choose Save Image As from the context menu, and download them to your C:/websites/bootstrap/assets/img sub-folder.
Your folder structure should now look as shown below.
When creating web pages, designers often add coloured borders to div tags to guide their actions. Let's do this with the new web page you have created.
For simplicity, we will add this new coloured border CSS class directly to the web page instead of to a separate stylesheet file.
<style> .container { border: solid 2px red } </style>Your head section should now look as shown below.
View your bootstrap-practical-layouts.html web page in your browser. As you can see, all the container div blocks are now highlighted with a two pixel-wide red border.
Next, we will download a custom stylesheet that adjusts the default Bootstrap grid so that it becomes a more practical starting point for designing modern-looking web pages.
Your folder structure should now look as shown below.
Your next task is to add the custom stylesheet to your web page.
<!-- Customise Bootstrap for practical grid layouts --> <link rel="stylesheet" href="assets/css/bootstrap-custom.css">
In your browser, your web page should look as shown below.
As you can see, there is now much more spacing around the rows and columns of content.
You can see an example of the finished web page below.
In addition to styles that increase the spacing around the Bootstrap grid elements, the bootstrap/assets/css stylesheet also includes some sample background colours to work with.
Let's experiment with some of these by adding them to your bootstrap-practical-layouts.html web page.
Notice that, when you added a dark background to a column, the text inside that column changed to white. This is the result of the following line in the bootstrap-custom.css stylesheet.
This style rule states that: if the column contains a class whose name includes "-dark", set the colour of the font inside that column to white.
Next, let's add a background to an entire horizontal row, so that the background colour covers the full width of the browser screen.
You can see an example of the finished web page below.
In this next exercise you will add some sample images to your bootstrap-practical-layouts.html web page.
<img src="assets/img/bambam-1200x300.jpg" alt="Bambam">Position the image to just above the h1 heading as shown below. When you save your page, you can see that the image is not displaying correctly. To ensure your images display correctly inside a Boostrap grid, you need always to add the img-fluid class to the image as shown below. Resave your web page and verify that the image now displays correctly in your web browser.
<img src="assets/img/bambam-700x450.jpg" class="img-fluid" alt="Bambam">Position the image to just above the h2 sub-headings as shown below.
<img src="assets/img/bambam-700x400.jpg" class="img-fluid" alt="Bambam">Position the image to just above the h2 sub-headings as shown below.
<img src="assets/img/bambam-700x400.jpg" class="img-fluid" alt="Bambam">Position the image to just above the h2 sub-headings as shown below.
Save your web page and verify the images all display correctly in your web browser.
You can see an example of the finished web page below.
As a final step, remove the style from the head of the web page that adds the red-coloured borders to container elements.
You can see an example of the finished web page below.
Follow these steps below to upload your entire Bootstrap folder to your website on GitHub.
Your uploaded web page is published on GitHub at a web address similar to the following, where username is the username you have chosen for your GitHub account:
https://username.github.io/bootstrap/bootstrap-practical-layouts.html
It may take a few minutes for your uploaded files to appear on GitHub.
Whitespace in Web Design: What It Is and Why You Should Use It
From Gisele Muller on Treehouse.
A Guide to Effective Use of White Space in Web Design
From Joanne Amos on Flywheel.
White Space Design: 20 Striking Examples and Best Practices
From Josesp Downes on Just in Mind.
What Is Whitespace? 9 Websites to Inspire Your Web Design
From Karla Cook on HubSpot Marketing Blog.
White-Space at Work: Why Less is More in Your Website Design
From Sherice Jacob on Crazyegg Blog.
White Space - A Perfect Option For Improving Usability In Web Designs
From Isabella Morris on Usability Geek.
Return to Contents.