Saturday, 25 July 2015

Create First Web Page With Bootstrap

Create First Web Page With Bootstrap

Here, we are creating a HTML web page using Bootstrap Framework.

<!DOCTYPE html>
<html lang="en">
<head>
  <title>My First Bootstrap Page</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">
  <h1>My First Bootstrap Page</h1>   
<p> Hi Smart Developer! Now you are ready to learn bootstrap framework. Keep your enthusiasm up to the end.
</div>
</body>
</html>
Following is the point to understand this program properly.

1) It is a sample page created using HTML and Bootstrap.
2) Bootstrap CDN link is added in head section with jquery.
3) Bootstrap also requires a containing element to wrap site contents.
    There are two container classes.

    1) .container class provides a responsive fixed width container.
    2) .container-fluid class provides a full width container, fit to entire width of the view port. 

    Note: Containers are not nestable (you cannot put a container inside another container).
4)  viewport meta tag is also important part of Bootstrap to make site responsive and to ensure proper rendering and touch zooming, add the following <meta> tag inside the <head> element:

<meta name="viewport" content="width=device-width, initial-scale=1">
   1) width=device-width sets the width of the page same as device screen width.
  2) initial-scale=1 part sets the initial zoom level when the page is first loaded by the browser.

 That's It. Now Copy the code in notepad, save it in .html file and try it your self. check it's responsiveness by resize using browser.

Advantages and Disadvantages of Bootstrap

Pros and Cons of Bootstrap

Pros (Advantages) :-

  • works in all modern browsers
  • "mobile first" approach in after version3
  • Responsive approach
  • normalizes many little CSS annoyances
  • lightweight then others
  • gives consistent look and feel.
  • customizable as per requirement
  • encourages use of LESS CSS and JavaScript.
  • helps beginner to create nice application with little effort.
  • many nice looking free and paid starter UI, Mobile and Website templates are available.
  • integrated with jQuery (some might consider this a negative)
  • some jQuery plugins now offer Bootstrap theming
  • comes with some jQuery plugins

Cons (Disadvantages)

  • Hard to create complex data-entry screens. Of course, screens should be made simple for users, but that doesn't mean a form might not be technically complex. Sometimes, users are well-trained and want complex forms so that they can rapidly do work.
  • jQuery plugins are limited. Certainly, you can integrate your own, find other 3rd party controls, etc. But out of the box, you are missing the heavy-hitters, like grids, tree views, drag and drop, etc.
  • Naming conventions and semantics are mediocre. Example: using the <i> tag for icons. Class names like "pull-right".
  • It's very customizable, but inevitably many sites start looking alike (just like Wordpress—consider how many blog sites look the same).

Where to Get Bootstrap?

Where to Get Bootstrap

There are two ways to start using Bootstrap on your own web site.
  • Download Bootstrap from getbootstrap.com and include this in your website's local folder.
  • Include Bootstrap from a CDN

Downloading Bootstrap

you can download Bootstrap yourself, just go to getbootstrap.com, and follow the instructions available there.

Bootstrap CDN (Content Delivery Network)

If you do not want to download and use it directly then you can use CDN provided by MaxCDN. It provides both Bootstrap's CSS and JavaScript CDN link. JQuery can also be available in CDN, if you want to use it using CDN.
CDN link is here :-
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

<!-- Latest compiled JavaScript -->
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
CDN Insures availability and speed than local copy of library. So, it is a recommended way to use build-in libraries.


History of Bootstrap

Bootstrap History

 

Bootstrap was developed by Mark Otto and Jacob Thornton at Twitter, and released as an open source product in August 2011 on GitHub. It was created at Twitter in mid-2010. Prior to being an open-sourced framework, Bootstrap was known as Twitter Blueprint. Now it had over more then 20 release, including two major rewrites with v2 and v3. With Bootstrap 2, responsive functionality was added to the entire framework as an optional style sheet. Building on that with Bootstrap 3, it was rewrote the library once more to make it responsive by default with a mobile first approach.

Click here to see all releases since the beginning.