Book Image

Learning Bootstrap 4 by Building Projects

Book Image

Learning Bootstrap 4 by Building Projects

Overview of this book

Bootstrap, the world’s most popular frontend framework, is an open source toolkit for building web applications with HTML, CSS, and JavaScript. Learning Bootstrap 4 by Building Projects covers the essentials of Bootstrap 4 along with best practices. The book begins by introducing you to the latest features of Bootstrap 4. You will learn different elements and components of Bootstrap, such as the strict grid system, Sass, which replaced Less, flexbox, Font Awesome, and cards. As you make your way through the chapters, you will use a template that will help you to build different kinds of real-world websites, such as a social media website, a company landing page, a media hosting website, and a profile page, with ease. By the end of this book, you will have built websites that are visually appealing, responsive, and robust.
Table of Contents (9 chapters)
Free Chapter
1
Introduction

Styling the home page

In this section, we are going to add style to our home page. Before we get into our styling, we want to go ahead and create four variables in our style.scss file:

$primary-color:#3b5a76;
$background-color:#ededed;
$text-color:#363636;
$font:16px;

So, here we have added a primary color, background color, text color, and font size. Now, we're going to start off with a body tag in our style.scss file:

 body {
padding-bottom:0;
font-family: 'Open Sans', Arial, Tahoma;
color:$text-color;
background: $background-color;
font-size: $font;
}

For the body, we will have no padding on the bottom; we're going to reference particular fonts that are being used, so we'll have Open Sans. This is inside of single quotes because it is a compound word. We'll have Arial and Tahoma as well. Next, we added color, which is going to...