You are previewing Bootstrap By Example.
O'Reilly logo
Bootstrap By Example

Book Description

Master Bootstrap 4's frontend framework and build your websites faster than ever before

About This Book

  • Become an expert in Bootstrap framework, and speed up front-end development and prototyping through real-life examples

  • An applied guide exploring two web applications such as Twitter and Dashboard from scratch

  • Hands on the Bootstrap version 4 even before the official release

  • Who This Book Is For

    If you are a frontend developer with no knowledge of Bootstrap, then this book is for you. Basic knowledge of HTML, CSS, and JavaScript is expected, as well as a reasonable understanding of web frameworks, such as jQuery.

    What You Will Learn

  • Discover how to use Bootstrap’s components and elements, and to customize them for your own projects

  • Understand the framework’s usage in the best way with the recommended development patterns

  • Create web pages for any kind of device like tablet, mobile, computer, etc.

  • Construct a Twitter app by exploring the advanced bootstrap components like Breadcrumbs, Pagination, Media objects, and so on

  • Combine the power of JavaScript with your Bootstrap app for more functionality

  • Create a Dashboard web app using Bootstrap’s JavaScript plugins

  • Learn the difference between Bootstrap’s version 3 and 4 of the framework

  • Extend your knowledge on Bootstrap’s external plugins, their incorporation and usage

  • In Detail

    Bootstrap is a free, open source collection of tools that helps developers create websites or web applications. It provides a faster, easier, and less repetitive solution to designing and building applications. Before Bootstrap’s release, it was necessary to import a variety of libraries into your project that offered different components and features for web interface development. Plus with the increased popularity of smartphones there were lack of libraries that could handle the responsiveness of a web page. Bootstrap‘s existence let it quickly become famous as a front-end framework that offered a wide set of tools from page grid up to components that render a web page in the best possible way for any device.

    This book will be a tutorial covering various examples as well as step-by-step methodology to create interesting web applications using Bootstrap and to understand the front-end framework to its core.

    We begin with an introduction to the Bootstrap framework and setting up an environment to build a simple web page. We then cover the grid system, basic Bootstrap components, HTML elements, and customization components for responsive and mobile first development. This is presented by creating a beautiful Landing page sample. You will also learn how to create a web application like Twitter by using the full set of components offered in the framework. Finally, you will learn to create a dashboard web app, using Bootstrap to its finest potential including component customizations, event handling, and external library integration. All these examples are explained step-by-step and in depth, while covering the versions 3 and the most recent version 4 of Bootstrap. So, you will be in the state of the art for front-end development.

    By the end of this book, you will be familiar with the development of a plugin for the framework and Bootstrap’s world which is popular for fast paced front-end web development, used in countless projects all over the world, and now yours.

    Style and approach

    This is a step-by-step guide that closely focuses on developing web applications in most objective way solving real-life problems with Bootstrap. It covers two sample web applications, which are explained in detail.

    Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

    Table of Contents

    1. Bootstrap By Example
      1. Table of Contents
      2. Bootstrap By Example
      3. Credits
      4. About the Author
      5. About the Reviewer
      6. www.PacktPub.com
        1. eBooks, discount offers, and more
          1. Why subscribe?
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Downloading the color images of this book
          3. Errata
          4. Piracy
          5. Questions
      8. 1. Getting Started
        1. Getting Bootstrap
        2. Setting up the framework
          1. Folder structure
          2. Warming up the sample example
          3. Bootstrap required tags
        3. Building our first Bootstrap example
          1. The container tag
        4. Optionally using the CDN setup
        5. Community activity
          1. Tools
        6. Bootstrap and web applications
        7. Browser compatibility
        8. Summary
      9. 2. Creating a Solid Scaffolding
        1. Understanding the grid system
        2. Building our scaffolding
          1. Setting things up
          2. Offset columns
          3. Completing the grid rows
          4. Nesting rows
          5. Finishing the grid
        3. Fluid container
        4. We need some style!
          1. There are headings everywhere
          2. Playing with buttons
          3. More typography and code tags
        5. Manipulating tables
          1. Styling the buttons
        6. Like a boss!
        7. Final thoughts
          1. Box-sizing
          2. Quick floats
          3. Clearfix
          4. Font definitions for typography
        8. Summary
      10. 3. Yes, You Should Go Mobile First
        1. Making it greater
        2. Bootstrap and the mobile-first design
        3. How to debug different viewports at the browser
        4. Cleaning up the mess
        5. Creating the landing page for different devices
          1. Mobile and extra small devices
          2. Tablets and small devices
          3. Desktop and large devices
        6. Summary
      11. 4. Applying the Bootstrap Style
        1. Changing our grid layout
          1. Starting over the grid system
            1. The header
            2. The introduction header
            3. The about section
            4. The features section
            5. The price table section
            6. The footer
          2. Forming the forms
            1. Newsletter form
            2. Contact form
              1. Let's start with some JavaScript
            3. The sign-in form
          3. Images
          4. Helpers
            1. Floating and centering blocks
            2. Context colors
            3. Spacing
            4. Responsive embeds
        2. Summary
      12. 5. Making It Fancy
        1. Using Bootstrap icons
        2. Paying attention to your navigation
          1. Until the navigation collapse
          2. Using different attachments
          3. Coloring the bar
        3. Dropping it down
          1. Customizing buttons dropdown
        4. Making an input grouping
        5. Getting ready for flexbox!
          1. Understanding flexbox
          2. Playing with Bootstrap and flexbox
        6. Summary
      13. 6. Can You Build a Web App?
        1. Understanding web applications
          1. Creating the code structure
        2. Adding the navigation
          1. Adding the search input
          2. Time for the menu options!
            1. The option at the thumbnail
            2. Adding the Tweet button
          3. Customizing the navigation bar
            1. Setting up the custom theme
            2. Fixing the list navigation bar pseudo-classes
          4. You deserve a badge!
          5. Fixing some issues with the navigation bar
        3. Do a grid again
        4. Playing the cards
          1. Learning cards in Bootstrap 4
          2. Creating your own cards
          3. Adding Cards to our web application
          4. Another card using thumbnails
        5. Implementing the main content
          1. Making your feed
          2. Doing some pagination
        6. Creating breadcrumbs
        7. Finishing with the right-hand-side content
        8. Summary
      14. 7. Of Course, You Can Build a Web App!
        1. Alerts in our web app
          1. Dismissing alerts
          2. Customizing alerts
        2. Waiting for the progress bar
          1. Progress bar options
          2. Animating the progress bar
        3. Creating a settings page
          1. Pills of stack
          2. Tabs in the middle
            1. Adding the tab content
            2. Using the Bootstrap tabs plugin
          3. Creating content in the user info tab
          4. The stats column
          5. Labels and badges
        4. Summary
      15. 8. Working with JavaScript
        1. Understanding JavaScript plugins
          1. The library dependencies
          2. Data attributes
          3. Bootstrap JavaScript events
        2. Awesome Bootstrap modals
          1. Modal general and content
          2. The modal header
          3. The modal body
          4. The modal footer
        3. Creating our custom modal
        4. A tool for your tip
        5. Pop it all over
          1. Popover events
        6. Making the menu affix
        7. Finishing the web app
        8. Summary
      16. 9. Entering in the Advanced Mode
        1. The master plan
        2. The last navigation bar with flexbox
          1. The navigation search
          2. The menu needs navigation
          3. Checking the profile
        3. Filling the main fluid content
          1. From the side stacked menu
          2. I heard that the left menu is great!
          3. Learning the collapse plugin
          4. Using some advanced CSS
        4. Filling the main content
          1. Rounding the charts
          2. Creating a quick statistical card
          3. Getting a spider chart
        5. Overhead loading
        6. Fixing the toggle button for mobile
        7. Summary
      17. 10. Bringing Components to Life
        1. Creating the main cards
          1. The other card using Bootstrap components
          2. Creating our last plot
        2. Fixing the mobile viewport
          1. Fixing the navigation menu
          2. The notification list needs some style
          3. Adding the missing left menu
          4. Aligning the round charts
        3. Learning more advanced plugins
          1. Using the Bootstrap carousel
            1. Customizing carousel items
            2. Creating slide indicators
            3. Adding navigation controls
            4. Other methods and options for the carousel
          2. The Bootstrap spy
        4. Summary
      18. 11. Making It Your Taste
        1. Customizing a Bootstrap component
          1. The taste of your button
          2. Using button toggle
          3. The checkbox toggle buttons
          4. The button as a radio button
          5. Doing the JavaScript customization
        2. Working with plugin customization
        3. The additional Bootstrap plugins
        4. Creating our Bootstrap plugin
          1. Creating the plugin scaffold
        5. Defining the plugin methods
          1. The initialize method and plugin verifications
          2. Adding the Bootstrap template
          3. Creating the original template
            1. The slide deck
            2. The carousel indicators
            3. The carousel controls
          4. Initializing the original plugin
          5. Making the plugin alive
        6. Creating additional plugin methods
        7. Summary
      19. Index