Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Bootstrap Site Blueprints Volume II

You're reading from   Bootstrap Site Blueprints Volume II Maximize the potential of Bootstrap for faster and more responsive web applications

Arrow left icon
Product type Paperback
Published in Jan 2016
Publisher Packt
ISBN-13 9781785281099
Length 328 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Matt Lambert Matt Lambert
Author Profile Icon Matt Lambert
Matt Lambert
Arrow right icon
View More author details
Toc

Coding the home page


The first of two templates for this project is the home page. This page is made up of a flexbox grid that is wrapped into the Bootstrap grid code. Following the grid, we'll add a pagination section. The entire body of the page is wrapped in the following HTML:

<div class="page-body">
  ..
</div>

This section has top and bottom margins attached to it. This is the same spacing that we'll use on the article page, so you'll see .article class in there as well:

.page-body,
.article {
  margin: (@margin * 2) 0;
}

Creating a post grid with flexbox

Before we jump fully into the flexbox code, let's outline the basic structure of a row of posts. Each row of our grid will have four posts in it. As with the footer, we want rows to stretch across the width of the layout, so we'll be omitting the .container <div>. Here's the basic structure of a row:

<div class="row">
  <div class="col-lg-12">
    <div class="flex-parent">
      <div class="flex-child...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime