Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Learning Bootstrap 4 by Building Projects
Learning Bootstrap 4 by Building Projects

Learning Bootstrap 4 by Building Projects: Develop 5 real-world Bootstrap 4.x projects from scratch

Arrow left icon
Profile Icon Eduonix Learning Solutions
Arrow right icon
€18.99 per month
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2 (1 Ratings)
Paperback Aug 2018 218 pages 1st Edition
eBook
€15.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Eduonix Learning Solutions
Arrow right icon
€18.99 per month
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2 (1 Ratings)
Paperback Aug 2018 218 pages 1st Edition
eBook
€15.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€15.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Learning Bootstrap 4 by Building Projects

Bootstrap 4 Features

In this chapter, we are going to learn about Bootstrap 4. We will basically get a general introduction to how Bootstrap works through the Hello-World program that we're going to create. This chapter starts off by introducing you to the changes that Bootstrap 4 offers. These changes are pretty exciting, and there are some good changes regarding the grids, fonts, and a lot of other things. We will go into detail about what these new changes are. We will then look into the code editor that we're going to use it's free, popular, easy to use, and it's cross-platform as well.

We will then get into initializing a new Bootstrap 4 project. Different people have their own ways of doing this — you can either work with the Content Delivery Network (CDN), which means you're always going to be dependent on an internet connection...

What's new in Bootstrap 4 – introducing new features

In this section, we're going to see what's new in Bootstrap 4. As we go through this book, we're also going to see examples of these new features in action as we build up our different projects.

Bootstrap 4 has got quite a few new features and we will be looking at the more popular ones. Flexbox is one of the main features that has been added, also known as CSS3 Flexible Box, and it's used a lot with the grid. It allows you to accomplish the more popular layouts as well as complex layouts easily, so if you were trying to do the same thing in CSS, it would be a little more difficult and challenging. Therefore, we're going to see how Flexbox really helps make the different kinds of layout that you want to achieve in an easier manner.

LESS has been replaced with Sass, so we will see a few examples...

Migrating to v4

Without further ado, open your favorite browser and visit the Migrating to Bootstrap 4 documentation page at https://getbootstrap.com/docs/4.0/migration/:

As you can see on the Migrating to v4 documentation page, there are several things on the left, and at the bottom we have Migration. Here, you will see a lot of the different changes that Bootstrap 4 introduced, of which a few were discussed earlier. It has dropped the support for IE8, IE9, and iOS6, which is only for IE10+ and iOS 7+. It has mobile browser support as well.

In the Global changes section, you will see some of the big changes. Flexbox is enabled by default, so they're getting away from things such as floats; they've switched from LESS to Sass for CSS; and another thing is they're favoring rems instead of px. px is still being used, but there's a lot more move toward rem, and...

Setting up the code editor

We are going to use the Visual Studio Code (VS Code) editor for our book. Let's go to https://code.visualstudio.com/, where you can go to the home page and learn more about the editor. Of course, as we go through this book, we're going to learn about what we need to know rather than just go through everything and do a whole tour of this editor, but here are some basics about the editor.

It's cross-platform, so you can use it on Windows or Mac, and it's free to use. One of the reasons I really prefer using this editor is, other than it being a great editor, you have an integrated terminal so you don't have to keep going out to your terminal or command line to run different commands on the command prompt. So, you can stay right here, inside of your editor, and pretty much do everything. As we move forward through this book, the...

Initializing a new project

Let's go to the Bootstrap website at https://getbootstrap.com. If you want to get the current release, you can just click the Download button and do an installation. However, that's not the route we're going to take. Here, I'll show you how we're going to install Bootstrap:

So, the current version is v4.1.3, as shown in the preceding screenshot. If you've never seen this website before, there's a lot of great documentation on Bootstrap. If you go to the menu and click on Documentation, we're going to use the Quick start to get the code going inside of VS Code. Then, we're going to do some initialization with another tool:

The website also has a few examples regarding what you can do with Bootstrap. You can check out these examples by clicking the Examples tab in the menu, as shown in the following screenshot...

A quick introduction to Sass

In this section, we're going to look at a quick introduction to Sass, so for anyone who's never used Sass, this is just going to get you up to speed on what it is and why we want to use it. If you have used it, this is just going to be a quick refresher. So, let's go to sass-lang.com:

This is the website where you can learn all about Sass, and the documentation is also really good. If you want to explore more than what we're going to do here, this is the place to go to. So, if we go into LEARN SASS, you can really get a quick introduction into how it's used.

If you scroll down the page, you will see an SCSS syntax, as shown in the following code. We're going to basically make use of variables periodically. If you've ever used Ruby, this might look familiar, since it's written in Ruby:

$font-stack: Helvetica...

Gulp

Now we're going to move on to building out our gulpfile. The first thing we want to do is put a gulpfile in the project area rather than the src file area. So, let's create a new file and call it gulpfile.js. The folder structure looks as follows:

The filename is important – you need to call it gulpfile.js so that Gulp can recognize it. Regarding our folder structure, this can be basically anything project-related or metadata-related for the forms of the parent folder, as shown previously. We have the src folder, where our actual web files are going to go, which are for displaying information on the website, or the kind of dependencies the website might need. This is how the folder structure is going to work as we go through our other different projects as well – this is going to kind of be a template.

Now, inside the gulpfile, we are going to create...

Hello world example

In the last section, we completed our gulpfile, so now we will add comments to the different sections of the code. We're also going to try and give this a run. We may have to do a little bit of debugging because there's quite a bit of code we had written and a lot of opportunities to make some syntax errors. Here, we'll see what happens when we try to get this to run, so let's get started. Most of the code is fairly descriptive because of the names that were given. The first two tasks were easy to understand; what the function does is gather the locations we want to compile, runs them through the compiler, drops them at a destination, and then we have our browser injection. Now let's look at the third task where we are launching the server. We will have to add comments, as follows:

//run sass when server runs
//run server
//watch for...

Summary

Let's quickly summarize what we've covered in this module. So, we got an introduction to Bootstrap 4 and what's new inside it. We've seen some great additions such as the Flexbox, the different changes they've done to the grids, we have new utilities that have come through, we have cards, and some of the new utilities such as Tether and the tool-tipping and the UI layout. Cards really are going to be a great UI feature that we can use and will probably look good on home pages or in sidebars. We also looked at our code editor, VS Code, which is made by Microsoft. It's a paired-down version of their IDE that's used to compile languages.

We also saw the integrated command-line tool and how to create a new project. Now, we have a template we can use going forward, which has got a particular folder structure. We've got Gulp for our task...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Create 5 responsive web apps with Bootstrap 4
  • Use elements and full Bootstrap toolkit to construct custom animations and templates
  • Design, customize, and create existing UIs and media aggregator apps

Description

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.

Who is this book for?

Learning Bootstrap 4 by Building Projects is for web developers who want to build real-world responsive websites from scratch using Bootstrap 4. Basic knowledge of HTML and CSS is required.

What you will learn

  • Get familiar with the new features of Bootstrap 4
  • Understand how the new grid system works
  • Learn to use the Sass tool in Bootstrap
  • Automate your tasks using the task runner, Gulp
  • Use Lightbox to build a photo gallery
  • Master best practices for HTML, CSS, and JavaScript

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Aug 31, 2018
Length: 218 pages
Edition : 1st
Language : English
ISBN-13 : 9781789343250
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Aug 31, 2018
Length: 218 pages
Edition : 1st
Language : English
ISBN-13 : 9781789343250
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 99.97
Responsive Web Design by Example
€32.99
Learning Bootstrap 4 by Building Projects
€29.99
Mastering Bootstrap 4
€36.99
Total 99.97 Stars icon

Table of Contents

8 Chapters
Introduction Chevron down icon Chevron up icon
Bootstrap 4 Features Chevron down icon Chevron up icon
Photosharing Website Chevron down icon Chevron up icon
Building a Resume Website Chevron down icon Chevron up icon
Social Network Frontend Chevron down icon Chevron up icon
Agency Website Chevron down icon Chevron up icon
Lightbox Website Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
(1 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 100%
1 star 0%
DRG Oct 10, 2018
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
The idea behind this book is a good one. However, this book is sorely in need of a professional editor.Many of the example images used to show what you should see after progressing to that point in the code don't match what the code will produce... at that point. One image showed styling that would not be rendered from the code until about 100+ Kindle locations later. I have not done a complete check of this, but it doesn't appear that even the example code you can download from the publisher's website would not render the examples either. Its as if no one sat down and followed the instructions, typing in the code as they went, to make sure the rendered pages match the examples of what to expect to see. There are example images that will never look the way they do in the book because the CSS needed to make some things happen is never added in the instructions. (Though, I have not yet finished the entire book.)If the author wrote one more "go ahead and" I would've asked for a refund. The entire book is riddled with fluff. The kind of extraneous wordiness common in the first drafts of nearly every how-to book ever written but normally edited out before publishing. Some sentences actually make no sense at all. The kinds of normal mistakes made, frequently, when re-writing a sentence but not re-reading it to be sure it still worked. The perspective and tense change without rhyme or reason. There are the beginnings of an explanation that are aborted after a "... but first ..." and the preempted topic has little to do with the code just completed or about to start.The explanation of what the code was doing is so poor its as if the writer has no idea why things are done this way. It reads like it was all just coped it from someone else's work without the writer understanding the topic. Or, it could also be read as if they assume too much existing skills but then that would mean the simplistic explanations are unneeded. For example, at one point the code includes adding a navigation bar with a class rule of "navbar navbar-expand-md navbar-light bg-light fixed-top." The explanation for that line? "The first one is going to be our navbar, which is basically the root class that we want to have some navbar functionality. Next, we have navbar-expand-md to make our navbar expand out, and we're going to have it triggered on a medium size. We're going to add navbar-light, which provides colors, and we're going to have a background color, bg-light. Finally, we're going to fix it to the top." Okay, what does the initial navbar do? What functionality do we get by including that? What are the implications of using navbar-expand-md? What other choices do we have and how do you add a non-expanding section? What rules will Bootstrap follow when expanding? Navbar-light provides what colors: white, black, rainbow? Do is it apply rules for link colors, background colors, pseudo-element colors, font colors, border-colors? And is the bg-light color a specific color? How do you change what color bg-light applies? Does it override any rules in navbar-light? What the other options besides navbar- and bg-light: -md, -dk? When building out the home page in the first few chapters, columnsget definitions like "col-lg-6" and the explanation is again very light on details. What do the three positions represent? Can you leave any of them out? What are the options? Some of it does get covered, but not until much later. There isn't even an explanation why one set of columns has a 6, one set has a 5 and yet another uses 4.One set of instructions to add a section to the home page appears in two different places making it look like it should appear twice in two different places on the same page. Often it is unclear where a snippet of code will go in the overall page.I spent more time researching the class names on w3schools and other sites, double checking my code to see why my version didn't match the version from the book, adding my own snippets of code to make my version match the examples in the book than I did reading and typing the code from the book. And you want to type the code not just copy and paste it. You learn, and retain, so much more by actually typing out the code. I visited the website for the publisher and there are a lot of books. If this book is any indication, someone there is hammering out a lot work, but the absence of an editor makes readers work harder than they should to overcome the weaknesses of the "final" product.To be fair, I have learned from the book (that's why it is a 2-star not 1). The initial set up in chapter 1 really helped me (after again, doing a lot of online research because there is nothing in the book about those of us using XAMPP, WAMP, or similar instead of the Apache and MySQL that came with the computer's OS). Troubleshooting my own mistakes versus the mistakes in the book taught me some things, but life is way too short for me to spend this much time pulling out my hair to compensate for others unwillingness or inability to proof and edit their work. Until the publisher matures and takes responsibility for their effect their readers' time and attention, I can't recommend anyone buy this or any other title from Eduonix Learning Solutions/Pact.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.