Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Bootstrap Site Blueprints Volume II

You're reading from  Bootstrap Site Blueprints Volume II

Product type Book
Published in Jan 2016
Publisher Packt
ISBN-13 9781785281099
Pages 328 pages
Edition 1st Edition
Languages
Author (1):
Matt Lambert Matt Lambert
Profile icon Matt Lambert

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 $15.99/month. Cancel anytime}