Thursday, May 30, 2019

Bootstrap


What is Bootstrap?
Bootstrap is a free and open source front end development framework for the creation of websites and web apps. The Bootstrap framework is built on HTML, CSS and JavaScript(JS) to facilitate the development of responsive, mobile-first sites and apps. 

Bootstrap download link:-  https://getbootstrap.com/docs/4.2/getting-started/download/

Typography

The elements below are HTML elements that will be styled a little bit differently by Bootstrap than browser defaults.

          Element/Class                                   Description



  1. <h1> - <h6>                                  h1 - h6 headings
  2. <small>                                     Creates a lighter, secondary text in any heading
  3. .small                                         Indicates smaller text (set to 85% of the size of the                                                          parent)
  4. .lead                                                       Makes a text stand out
  5. <mark>                                                   Highlights text
  6. <del>                                         Indicates deleted text
  7. <ins>                                         Indicates inserted text
  8. <u>                                            Indicates underlined text
  9. <strong>                                    Indicates bold text
  10. <em>                                         Indicates italic text
  11. .text-left                                     Indicates left-aligned text
  12. .text-center                                Indicates center-aligned text
  13. .text-right                                   Indicates right-aligned text
  14. .text-justify                                 Indicates justified text
  15. .text-nowrap                              Indicates no wrap text
  16. .text-lowercase                         Indicates lower cased text
  17. .text-uppercase                         Indicates upper cased text
  18. .text-capitalize                           Indicates capitalized text


Bootstrap Grid System

Grid Classes

The Bootstrap grid system has four classes:

  1. xs (for phones - screens less than 768px wide)
  2. sm (for tablets - screens equal to or greater than 768px wide)
  3. md (for small laptops - screens equal to or greater than 992px wide)
  4. lg (for laptops and desktops - screens equal to or greater than 1200px wide)

The classes above can be combined to create more dynamic and flexible layouts.

Grid Example

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

<div class="container-fluid">
  <h1>Hello World!</h1>
  <p>Resize the browser window to see the effect.</p>
  <p>The columns will automatically stack on top of each other when the screen is less than 768px wide.</p>
  <div class="row">
    <div class="col-sm-4" style="background-color:lavender;">.col-sm-4</div>
    <div class="col-sm-4" style="background-color:lavenderblush;">.col-sm-4</div>
    <div class="col-sm-4" style="background-color:lavender;">.col-sm-4</div>
  </div>
</div>

</body>
</html>

Button Styles
To achieve the button styles, Bootstrap has the following classes:

  1. .btn
  2. .btn-default
  3. .btn-primary
  4. .btn-success
  5. .btn-info
  6. .btn-warning
  7. .btn-danger
  8. .btn-link
Button style examples

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

<div class="container">
  <h2>Button Styles</h2>
  <button type="button" class="btn">Basic</button>
  <button type="button" class="btn btn-default">Default</button>
  <button type="button" class="btn btn-primary">Primary</button>
  <button type="button" class="btn btn-success">Success</button>
  <button type="button" class="btn btn-info">Info</button>
  <button type="button" class="btn btn-warning">Warning</button>
  <button type="button" class="btn btn-danger">Danger</button>
  <button type="button" class="btn btn-link">Link</button>      
</div>

</body>
</html>


Button Sizes

The classes that define the different sizes are:
  1. btn-lg
  2. .btn-md
  3. .btn-sm
  4. .btn-xs

No comments:

Post a Comment

Express

What is Express? Express is a minimal and flexible Node.js web application framework that provides a robust set of features to develo...