Chapter 13. Bootstrap – The Stylish CSS Frontend Framework

Bootstrap is a frontend framework and open source tool for developing websites and applications using HTML and CSS.

Twitter Blueprint was the initial name given to Bootstrap. Mark Otto and Jacob Thornton developed Bootstrap and used Twitter as the framework for consistency. According to Twitter developer Mark Otto:

"A super small group of developers and I got together to design and build a new internal tool and saw an opportunity to do something more. Through that process, we saw ourselves build something much more substantial than another internal tool. Months later, we ended up with an early version of Bootstrap as a way to document and share common design patterns and assets within the company."

The first official release of Bootstrap was August 19, 2011. There are currently three versions of Bootstrap. However, Bootstrap 4 has been announced but its final version is yet to be released.

Introduction to Bootstrap foundations

Bootstrap is compatible with the most recent versions of many web browsers including Firefox, Opera, Internet Explorer, Google Chrome, and Safari browsers.

The HTML5 doctype

To get started with Bootstrap, the following piece of code for HTML5 doctype must be included in every bootstrap project:

<!DOCTYPE html>
<html lang="en">
  ... 
</html>

Mobile first

Bootstrap is very mobile friendly. Mobile First styles are all included in a library and not scattered among various files. For accurate rendering and touch zooming, add the viewport meta tag to <head>:

<meta name="viewport" content="width=device-width, initial-scale=1.0">

Zooming can be disabled by setting the property user-scalable to no in the viewport meta tag, as shown here:

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

Responsive images

Images can be made to respond to various screen sizes using a simple class, as follows:

<img src="..." class="img-responsive" alt="Responsive image">

Containers

In bootstrap, all the web page content and the grid system is wrapped inside a main container. These containers are not nestable.

There are two types of containers, they are as follows:

  • Responsive fixed width container, for example:
    <div class="container"></div>
  • Responsive full width container, for example:
    <div class="container-fluid"></div>
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.103.204