Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Bootstrap [part 1]

263 views

Published on

It include bootstrap introduction,Normalize CSS,Grid,Responsive Web Design ,Panels,jumbotron,image,alert,button....etc

Published in: Education
  • ➤➤ 3 Reasons Why You Shouldn't take Pills for ED (important) ★★★ https://tinyurl.com/rockhardxxx
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • ★★ How Long Does She Want You to Last? ★★ A recent study proved that the average man lasts just 2-5 minutes in bed (during intercourse). The study also showed that many women need at least 7-10 minutes of intercourse to reach "The Big O" - and, worse still... 30% of women never get there during intercourse. Clearly, most men are NOT fulfilling there women's needs in bed. Now, as I've said many times - how long you can last is no guarantee of being a GREAT LOVER. But, not being able to last 20, 30 minutes or more, is definitely a sign that you're not going to "set your woman's world on fire" between the sheets. Question is: "What can you do to last longer?" Well, one of the best recommendations I can give you today is to read THIS report. In it, you'll discover a detailed guide to an Ancient Taoist Thrusting Technique that can help any man to last much longer in bed. I can vouch 100% for the technique because my husband has been using it for years :) Here's the link to the report ★★★ http://ishbv.com/rockhardx/pdf
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Bootstrap [part 1]

  1. 1. BOOTSTRAP PART 1
  2. 2. What is web Framework? • A web framework (WF) or web application framework (WAF) is a software framework that is designed to support the development of web applications including web services, web resources, and web APIs. • For example, many web frameworks provide libraries for database access, templating frameworks, and session management, and they often promote code reuse.
  3. 3. Types…… • Model–view–controller (MVC) • Push-based vs. pull-based • Three-tier organization
  4. 4. Web framework of Bootstrap • Bootstrap is a free and open-source front-end web framework for designing websites and web applications. • Unlike many web frameworks, it concerns itself with front-end development only.
  5. 5. What is Bootstrap??? • Bootstrap is a free front-end framework for faster and easier web development. • Bootstrap includes HTML and CSS based design templates for typography, forms, buttons, tables, navigation, modals, image carousels and many other, as well as optional JavaScript plugins. • Bootstrap also gives you the ability to easily create responsive designs.
  6. 6. Responsive web design • Responsive web design is about creating web sites which automatically adjust themselves to look good on all devices, from small phones to large desktops.
  7. 7. 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. • In June 2014 Bootstrap was the No.1 project on GitHub!
  8. 8. Advantages of Bootstrap • Easy to use: Anybody with just basic knowledge of HTML and CSS can start using Bootstrap. • Responsive features: Bootstrap's responsive CSS adjusts to phones, tablets, and desktops. • Mobile-first approach: In Bootstrap 3, mobile-first styles are part of the core framework. • Browser compatibility: Bootstrap is compatible with all modern browsers (Chrome, Firefox, Internet Explorer, Safari, and Opera).
  9. 9. Downloading and Installing Bootstrap • Where to get Bootstrap? • Other ways to get Bootstrap?
  10. 10. Where to get Bootstrap? • We can easily download the bootstrap set up file from the internet. • The site were we can get the bootstrap file is: http://getbootstrap.com/
  11. 11. Where to get Bootstrap?(cont….)
  12. 12. Where to get Bootstrap?(cont….)
  13. 13. Where to get Bootstrap?(cont….) • Click on Download Bootstrap. • Once the Downloading is completed you can see 3 folders: 1. Css 2. Fonts 3. Js
  14. 14. Other ways to get Bootstrap? • Bootstrap CDN(Content Delivery Network). <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/ css/bootstrap.min.css"> <!-- jQuery library --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/j query.min.js"></script> <!-- Latest compiled JavaScript --> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/j s/bootstrap.min.js"></script>
  15. 15. Build Your First Bootstrap Website With The Basic Template 1. Minimum Bootstrap page 2. Basic Bootstrap template 3. More Bootstrap sample templates
  16. 16. 1. Minimum Bootstrap Page Add the HTML5 doctype • Bootstrap uses HTML elements and CSS properties that require the HTML5 doctype. • Always include the HTML5 doctype at the beginning of the page, along with the lang attribute and the correct character set: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> </head> </html>
  17. 17. 1. Minimum Bootstrap Page(cont….) Bootstrap 3 is mobile-first • Bootstrap 3 is designed to be responsive to mobile devices. Mobile-first styles are part of the core framework. • 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“>
  18. 18. 1. Minimum Bootstrap Page(cont….) Container • Bootstrap also requires a containing element to wrap site contents. • There are two container classes to choose from: 1. The .container class provides a responsive fixed width container 2. The .container-fluid class provides a full width container, spanning the entire width of the viewport
  19. 19. • <!DOCTYPE html> <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.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script > </head> <body> <div class="container"> <h1>My First Bootstrap Page</h1> <p>This is some text.</p> </div> </body> </html>
  20. 20. OUTPUT:
  21. 21. 2. Basic Bootstrap Template • There are basic three bootstrap template. 1. Blog. 2. Portfolio. 3. Webpage.
  22. 22. 3.More Bootstrap Sample Templates • There are more three basic bootstrap templates 1. Social. 2. Marketing. 3. Online Store.
  23. 23. Normalize CSS • Normalize.css is a small CSS file that provides better cross-browser consistency in the default styling of HTML elements. It’s a modern, HTML5-ready, alternative to the traditional CSS reset. • Normalize.css is currently used in some form by Twitter Bootstrap, HTML5 Boilerplate, GOV.UK, Rdio, CSS Tricks, and many other frameworks, toolkits, and sites.
  24. 24. The aims of normalize.css are as follows: • Preserve useful browser defaults rather than erasing them. • Normalize styles for a wide range of HTML elements. • Correct bugs and common browser inconsistencies. • Improve usability with subtle improvements. • Explain the code using comments and detailed documentation. • It supports a wide range of browsers (including mobile browsers) and includes CSS that normalizes HTML5 elements, typography, lists, embedded content, forms, and tables.
  25. 25. Resetting or Normalizing Default Styles • Two ways to level differences between default browser style sheets: – Begin main style sheet with a CSS reset that effectively sets all the default element styles to “zero.” – Begin main style sheet with normalize.css, which tweaks default styles to look very similar across browsers.
  26. 26. Reset and Normalize Examples
  27. 27. How to use Normalize CSS • First, install or download normalize.css from GitHub. There are then 2 main ways to make use of it. • Approach 1: use normalize.css as a starting point for your own project’s base CSS, customising the values to match the design’s requirements. • Approach 2: include normalize.css untouched and build upon it, overriding the defaults later in your CSS if necessary.
  28. 28. What is Grid?? • In graphic design, a grid is a structure (usually two- dimensional) made up of a series of intersecting straight ( vertical, horizontal, and angular) or curved guide lines used to structure content. • The grid serves as an framework on which a designer can organize graphic elements (images, glyphs, paragraphs, etc.) in a rational, easy- to-absorb manner. • A grid can be used to organize graphic elements in relation to a page, in relation to other graphic elements on the page, or relation to other parts of the same graphic element or shape.
  29. 29. • Grid Lines • Grid Tracks • Grid Lines are the lines that make up the grid. These can be horizontal or vertical. We can refer to them by number, or by name. • A Grid Track is the space between two Grid Lines, either horizontal or vertical
  30. 30. • Grid Cell • Grid Area • A Grid Cell is the space between 4 Grid Lines. So it is the smallest unit on our grid that is available for us to place an item into. Conceptually it is just like a table cell. • A Grid Area is any area on the Grid bound by four grid lines. It may contain a number of Grid Cells.
  31. 31. Bootstrap grid system • Bootstrap's grid system allows up to 12 columns across the page. • If you do not want to use all 12 columns individually, you can group the columns together to create wider columns:
  32. 32. Grid System Rules Some Bootstrap grid system rules: • Rows must be placed within a .container (fixed- width) or .container-fluid (full-width) for proper alignment and padding. • Use rows to create horizontal groups of columns • Content should be placed within columns, and only columns may be immediate children of rows. • Predefined classes like .row and .col-sm-4 are available for quickly making grid layouts.
  33. 33. • Columns create gutters (gaps between column content) via padding. That padding is offset in rows for the first and last column via negative margin on .rows. • Grid columns are created by specifying the number of 12 available columns you wish to span. For example, three equal columns would use three .col-sm-4.
  34. 34. Basic Structure of a Bootstrap Grid • <div class="container"> <div class="row"> <div class="col-*-*"></div> </div> <div class="row"> <div class="col-*-*"></div> <div class="col-*-*"></div> <div class="col-*-*"></div> </div> <div class="row"> ... </div> </div>
  35. 35. Bootstrap Grid with Fluid container: Small Devices <!DOCTYPE html> <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/bo otstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/ jquery/3.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bo otstrap/3.3.7/js/bootstrap.min.js"></script > </head> <div class="container-fluid"> <h1>Small Grid</h1> <p>The following example will result in a 25%/75% split on small, medium and large devices. On extra small devices, it will stack (100% width).</p> <p>Resize the browser window to see the effect.</p> <div class="row"> <div class="col-sm-3" style="background- color:yellow;"> HELLO WORLD </div> <div class="col-sm-9" style="background- color:pink;"> HELLO TANVI </div> </div> </div> </body> </html>
  36. 36. Output: After resizing the screen:
  37. 37. Bootstrap Grid Example: Medium Devices <!DOCTYPE html> <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/bo otstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/ jquery/3.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bo otstrap/3.3.7/js/bootstrap.min.js"></script > </head> <body> <div class="container-fluid"> <h1>Medium Grid</h1> <p>The following example will result in a 25%/75% split on small devices and a 50%/50% split on medium (and large) devices. On extra small devices, it will automatically stack (100%).</p> <div class="row"> <div class="col-sm-3 col-md-6" style="background-color:yellow;"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </div> <div class="col-sm-9 col-md-6" style="background-color:pink;"> Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo </div></div></div> </body></html>
  38. 38. Output:
  39. 39. Bootstrap Grid Example:Only Medium Devices <!DOCTYPE html> <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/bo otstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/ jquery/3.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bo otstrap/3.3.7/js/bootstrap.min.js"></scrip> </head> <body> <div class="container-fluid"> <h1>Medium Grid</h1> <p>The following example will result in a 50%/50% split on medium and large devices. On small (and extra small) devices, it will automatically stack (100%).</%).</p> <div class="row"> <div class="col-md-6" style="background- color:yellow;"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </div> <div class="col-md-6" style="background- color:pink;"> Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo </div></div></div> </body></html>
  40. 40. Output:
  41. 41. Bootstrap Grid Example: Large Devices <!DOCTYPE html> <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/boots trap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jqu ery/3.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootst rap/3.3.7/js/bootstrap.min.js"></script> </head> </body> <div class="container-fluid"> <h1>Large Grid</h1> <p>The following example will result in a 25%/75% split on small devices, a 50%/50% split on medium devices, and a 33%/66% split on large devices. On extra small devices, it will automatically stack (100%).</p> <div class="row"> <div class="col-sm-3 col-md-6 col-lg-4" style="background-color:yellow;"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </div> <div class="col-sm-9 col-md-6 col-lg-8" style="background-color:pink;"> Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. </div></div></div> </body></html>
  42. 42. Output:
  43. 43. Bootstrap Grid Example: Large Devices <!DOCTYPE html> <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/bo otstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/ jquery/3.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bo otstrap/3.3.7/js/bootstrap.min.js"></script > </head> </body> <div class="container-fluid"> <h1>Large Grid</h1> <p>The following example will result in a 50%/50% split on large devices. On medium, small and extra small devices, it will automatically stack (100%).</p> <p>Resize the browser window to see the effect.</p> <div class="row"> <div class="col-lg-6" style="background- color:yellow;"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </div> <div class=" col-lg-6" style="background- color:pink;"> Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. </div></div></div> </body></html>
  44. 44. Ouput:
  45. 45. What is Responsive Web Design or Layout • Responsive web design is a process of designing and building websites to provide better accessibility and optimal viewing experience to the user. • Responsive web design is a preferable alternative and an efficient way to target a wide range of devices with much less efforts. • Responsive layouts automatically adjust and adapts to any device screen size
  46. 46. Creating Responsive Layout with Bootstrap • new Bootstrap 3 mobile first grid system creating the responsive and mobile friendly websites has become much easier. • you don't need to include any additional style sheet to enable responsive feature. • Its four tiers grids classes provides better control over the layout as well as how it will be rendered on different types of devices
  47. 47. Bootstrap - Labels • Labels are great for offering counts, tips, or other Informations for pages. • Use class .label to display labels
  48. 48. Labels using Modifier Classes • In Bootstrap, we can get different types of variations to change appearance of the inline labels. These can be listed as follows: • label-default • label-primary • label-success Example • label-info • label-warning • label-danger
  49. 49. <!DOCTYPE html> <head> <title>Bootstrap Case</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial- scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/b ootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs /jquery/3.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bo otstrap/3.3.7/js/bootstrap.min.js"> </script>s </head> <body> <div class="container"> <h2>Contextual Label Classes</h2> <span class="label label- default">Default Label</span> <span class="label label- primary">Primary Label</span> <span class="label label- success">Success Label</span> <span class="label label-info">Info Label</span> <span class="label label- warning">Warning Label</span> <span class="label label- danger">Danger Label</span> </div> </body> </html>
  50. 50. Bootstrap - Badges • Badges are mainly used to highlight new or unread items. To use badges just add <span class = "badge"> Example
  51. 51. <!DOCTYPE html> <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/b ootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs /jquery/3.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bo otstrap/3.3.7/js/bootstrap.min.js"></script > </head> <body> <h3>Bootstrap - Badges</h3> <ul class = "nav nav-pills"> <li class = "active"> <a href = "#">Mailbox <span class = "badge">50</span> </a></li> <li><a href = "#">Profile</a></li> <li><a href = "#">Messages <span class = "badge">3</span> </a></li> </ul> </body> </html>
  52. 52. Bootstrap - Panels • Panel components are used when you want to put your DOM component in a box • Panels are created with the .panel class, and content inside the panel has a .panel-body class:
  53. 53. Bootstrap - Panels • Panels with Heading You can also add a heading to your panel with .panel- heading class. You can also include heading elements from <h1> to <h6> with a .panel-title class. • Panels with Footer The .panel-footer class can be used to wrap buttons or secondary text. • Panels with Contextual States Like other component you also add contextual state classes like .panel-primary, .panel-success, .panel-info, .panel-warning, or .panel-danger
  54. 54. <head> <title>Bootstrap Case</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial- scale=1"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bo otstrap/3.3.6/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs /jquery/1.12.2/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/boo tstrap/3.3.6/js/bootstrap.min.js"></script> <style type="text/css"> .bs-example{in:35px;} </style></head> <body><div class="bs-example"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">301 Moved Permanently</h3> </div> <div class="panel-body">The requested page has been permanently moved to a new location.</div> </div> <div class="panel panel-success"> <div class="panel-heading"> <h3 class="panel-title">302 OK</h3> </div> <div class="panel-body">The server successfully processed the request.</div> </div>
  55. 55. <div class="panel panel-info"> <div class="panel-heading"> <h3 class="panel-title">303 Continue</h3> </div> <div class="panel-body">The client should continue with its request.</div> </div> <div class="panel panel-warning"> <div class="panel-heading"> <h3 class="panel-title">400 Bad Request</h3> </div> <div class="panel-body">The request cannot be fulfilled due to bad syntax.</div> </div> <div class="panel panel-danger"> <div class="panel-heading"> <h3 class="panel-title">503 Service Unavailable</h3> </div> <div class="panel- body">The server is temporarily unable to handle the request.</div> <div class="panel-footer clearfix"> <div class="pull-right"> <a href="#" class="btn btn- primary">Learn More</a> <a href="#" class="btn btn- default">Go Back</a> </div> </div></div></div> </body> </html>
  56. 56. Bootstrap - Wells • A well is a container in <div> that causes the content to appear sunken or an inset effect on the page. • The .well class adds a rounded border around an element with a gray background color and some padding
  57. 57. Bootstrap - Wells • Sizing You can change the size of well using the optional classes such as,well-lg or well-sm. These classes are used in conjunction with .well class. These affect the padding, making the well larger or smaller depending on the class.
  58. 58. <!DOCTYPE html> <head> <title>Bootstrap Case</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial- scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.co m/bootstrap/3.3.7/css/bootstrap.min.c ss"> <script src="https://ajax.googleapis.com/ajax /libs/jquery/3.1.1/jquery.min.js"></sc ript> <script src="https://maxcdn.bootstrapcdn.co m/bootstrap/3.3.7/js/bootstrap.min.js" ></script> </head> <body> <div class="container"> <h2>Well Size</h2> <div class="well well-sm">Small Well</div> <div class="well">Normal Well</div> <div class="well well-lg">Large Well</div> </div> </html>
  59. 59. Bootstrap - Jumbotron • A jumbotron indicates a big box for calling extra attention to some special content or information. • Inside a jumbotron you can put nearly any valid HTML, including other Bootstrap elements/classes. • To use the Jumbotron − • Create a container <div> with the class of .jumbotron.
  60. 60. Bootstrap - Jumbotron • Jumbotron Inside Container Place the jumbotron inside the <div class="container"> if you want the jumbotron to NOT extend to the edge of the screen: • Jumbotron Outside Container Place the jumbotron outside the <div class="container"> if you want the jumbotron to extend to the screen edges:
  61. 61. Jumbotron Inside Container <div class = "container"> <div class = "jumbotron"> <h1>Welcome to Bootstrap Tutorial!</h1> <p>This is an example for jumbotron.</p> <p> <a class = "btn btn-primary btn- lg" role = "button">Learn more</a> </p> </div> </div> Jumbotron Outside Container <div class = "jumbotron"> <div class = "container"> <h1>Welcome to Bootstrap Tutorial!</h1> <p>This is an example for jumbotron.</p> <p> <a class = "btn btn-primary btn- lg" role = "button">Learn more</a> </p> </div> </div>
  62. 62. Bootstrap Text/Typography Class Description <h1> - <h6> Bootstrap will style the HTML headings (<h1> to <h6>) <small> In Bootstrap the HTML <small> element is used to create a lighter, secondary text in any heading <mark> Use the <mark> tag if you want to highlight parts of your text. <dl> The <dl> tag defines a description list. The <dl> tag is used in conjunction with <dt> (defines terms/names) and <dd> (describes each term/name). <code> The <code> tag is a phrase tag. It defines a piece of computer code. <kbd> Defines keyboard input. <pre> Text in a <pre> element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks.
  63. 63. .lead Makes a paragraph stand out .small Indicates smaller text (set to 85% of the size of the parent) .text-left Indicates left-aligned text .text-center Indicates center-aligned text .text-right Indicates right-aligned text .text-justify Indicates justified text .text-lowercase Indicates lowercased text .text-uppercase Indicates uppercased text .text-capitalize Indicates capitalized text .pre-scrollable Makes a <pre> element scrollable .dl-horizontal Lines up the terms (<dt>) and descriptions (<dd>) in <dl> elements side-by-side. Starts off like default <dl>s, but when the browser window expands, it will line up side-by-side
  64. 64. • <abbr>: <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.bootstrap cdn.com/bootstrap/3.3.7/css/bootstrap . min.css"> <script src="https://ajax.googleapis.co m/ajax/libs/jquery/3.1.1/jquery.min.js ></script> <script src="https://maxcdn.bootstrapcdn.co m/bootstrap/3.3.7/js/bootstrap.min.js" ></script> </head> <body> <div class="container"> <h1>Abbreviations</h1> <p>The abbr element is used to mark up an abbreviation or acronym:</p> <p>The <abbr title="World Health Organization">WHO</abbr> was founded in 1948.</p> </div> </body> </html>
  65. 65. Output:
  66. 66. Bootstrap Basic Table • A basic Bootstrap table has a light padding and only horizontal dividers. • The .table class adds basic styling to a table: <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.co m/bootstrap/3.3.7/css/bootstrap.min.c ss"> <script src="https://ajax.googleapis.com/ajax/ libs/jquery/3.1.1/jquery.min.js"></scri pt> <script src="https://maxcdn.bootstrapcdn.co m/bootstrap/3.3.7/js/bootstrap.min.js" ></script> </head> <body> <div class="container"> <h2>Basic Table</h2> <p>The .table class adds basic styling (light padding and only horizontal dividers) to a table:</p> <table class="table"> <thead> <tr> <th>Firstname</th> <th>Lastname</th> <th>Email</th> </tr> </thead> <tbody> <tr> <td>John</td> <td>Doe</td> <td>john@example.com</td> </tr> <tr> <td>Mary</td> <td>Moe</td> <td>mary@example.com</td>
  67. 67. </tr> </tbody> </table> </div> </body> </html>
  68. 68. Striped Rows <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.co m/bootstrap/3.3.7/css/bootstrap.min.c ss"> <script src="https://ajax.googleapis.com/ajax/ libs/jquery/3.1.1/jquery.min.js"></scri pt> <script src="https://maxcdn.bootstrapcdn.co m/bootstrap/3.3.7/js/bootstrap.min.js" ></scrip> </head><body> <div class="container"> <h2>Striped Rows</h2> <p>The .table-striped class adds zebra- stripes to a table:</p> <table class="table table-striped"> <thead> <tr> <th>Firstname</th> <th>Lastname</th> <th>Email</th> </tr> </thead> <tbody> <tr> <td>John</td> <td>Doe</td> <td>john@example.com</td> </tr> <tr> <td>Mary</td> <td>Moe</td> <td>mary@example.com</td>
  69. 69. </tr> </tbody> </table> </div> </body> </html>
  70. 70. Bordered Table <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.co m/bootstrap/3.3.7/css/bootstrap.min.c ss"> <script src="https://ajax.googleapis.com/ajax/ libs/jquery/3.1.1/jquery.min.js"></scri pt> <script src="https://maxcdn.bootstrapcdn.co m/bootstrap/3.3.7/js/bootstrap.min.js" ></script> </head> <body> <div class="container"> <h2>Bordered Table</h2> <p>The .table-bordered class adds borders to a table:</p> <table class="table table-bordered"> <thead> <tr> <th>Firstname</th> <th>Lastname</th> <th>Email</th> </tr> </thead> <tbody> <tr> <td>John</td> <td>Doe</td> <td>john@example.com</td>
  71. 71. </tr> </tbody> </table> </div> </body> </html>
  72. 72. Bootstrap Images • There are basically three different class to represent an image they are as follow: 1. Rounded Corners. 2. Circle. 3. Thumbnail.
  73. 73. 1. Rounded Corners • This class helps us to give a smooth rounded vertex in an image. • It is represented by img-rounded – Sysntax: <img src=“mount.jpg" class="img-rounded" width="304" height="236">
  74. 74. 2. Circle • This class helps us to give a circular image. • It is represented by img-circle – Sysntax: <img src=“mount.jpg" class="img-circle" width="304" height="236">
  75. 75. 3. Thumbnail • This class shapes the image to a thumbnail. • It is represented by img-thumbnail – Syntax: <img src=“mount.jpg" class="img-thumbnail" width="304" height="236">
  76. 76. <div class="container"> <h2>Circle</h2> <p>The img-circle class shapes the image to a circle (not available in IE8):</p> <img src="mount.jpg" class="img-circle" width="304" height="236"> </div> <div class="container"> <h2>Thumbnail</h2> <p>The img-thumbnail class shapes the image to a thumbnail:</p> <img src="mount.jpg" class="img-thumbnail" width="304" height="236"> </div>
  77. 77. Bootstrap Alert • Bootstrap provides an easy way to create predefined alert messages. • Alerts are created with the .alert class, followed by of the four contextual classes .alert-success, .alert-info, .alert-warning or .alert-danger.
  78. 78. div class="container"> <h2>Alerts</h2> <div class="alert alert-success"> <strong>Success!</strong> This alert box could indicate a successful or positive action. </div> <div class="alert alert-info"> <strong>Info!</strong> This alert box could indicate a neutral informative change or action. </div> <div class="alert alert-warning"> <strong>Warning!</strong> This alert box could indicate a warning that might need attention. </div> <div class="alert alert-danger"> <strong>Danger!</strong> This alert box could indicate a dangerous or potentially negative action. </div>
  79. 79. Alert Links • Add the .alert-link class to any links inside the alert box to create "matching colored links"
  80. 80. <div class="container"> <h2>Alert Links</h2> <p>Add the alert-link class to any links inside the alert box to create "matching colored links".</p> <div class="alert alert-success"> <strong>Success!</strong> You should <a href="#" class="alert-link">read this message</a>. </div> <div class="alert alert-info"> <strong>Info!</strong> You should <a href="#" class="alert-link">read this message</a>. </div> <div class="alert alert-warning"> <strong>Warning!</strong> You should <a href="#" class="alert-link">read this message</a>.</div> <div class="alert alert-danger"> <strong>Danger!</strong> You should <a href="#" class="alert-link">read this message</a>. </div>
  81. 81. Button group • Bootstrap allows you to group a series of buttons together (on a single line) in a button group. • Use a <div> element with class .btn-group to create a button group
  82. 82. Closing Alerts • To close the alert message, add a .alert- dismissable class to the alert container. Then add class=“close” and data-dismiss=“alert” to link or a button element (when you click on this the alert box will disappear).
  83. 83. Animated Alerts • The .fade and .in classes adds a fading effect when closing the alert message
  84. 84. <div class="container"> <h2>Animated Alerts</h2> <p>The .fade and .in classes adds a fading effect when closing the alert message.</p> <div class="alert alert-success alert- dismissable fade in"> <a href="#" class="close" data- dismiss="alert" aria- label="close">&times;</a> <strong>Success!</strong> This alert box could indicate a successful or positive action. </div> <div class="alert alert-info alert-dismissable fade in"> <a href="#" class="close" data- dismiss="alert" aria- label="close">&times;</a> <strong>Info!</strong> This alert box could indicate a neutral informative change or action. </div> <div class="alert alert-warning alert- dismissable fade in"> <a href="#" class="close" data- dismiss="alert" aria- label="close">&times;</a> <strong>Warning!</strong> This alert box could indicate a warning that might need attention. </div> <div class="alert alert-danger alert- dismissable fade in"> <a href="#" class="close" data- dismiss="alert" aria- label="close">&times;</a> <strong>Danger!</strong> This alert box could indicate a dangerous or potentially negative action. </div> </div>
  85. 85. Bootstrap Buttons 1. Button Styles • Bootstrap provides seven styles of buttons • To achieve the button styles above, Bootstrap has the following classes: 1. .btn-default 2. .btn-primary 3. .btn-success 4. .btn-info 5. .btn-warning 6. .btn-danger 7. .btn-link
  86. 86. <div class="container"> <h2>Button Styles</h2> <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>
  87. 87. Bootstrap Button 2. Block Level Button • A block level button spans the entire width of the parent element. • Add class .btn-block to create a block level button
  88. 88. <div class="container"> <h2>Block Level Buttons</h2> <button type="button" class="btn btn- primary btn-block">Button 1</button> <button type="button" class="btn btn-default btn-block">Button 2</button> <h2>Large Block Level Buttons</h2> <button type="button" class="btn btn- primary btn-lg btn-block">Button 1</button> <button type="button" class="btn btn-default btn-lg btn-block">Button 2</button> <h2>Small Block Level Buttons</h2> <button type="button" class="btn btn- primary btn-sm btn-block">Button 1</button> <button type="button" class="btn btn-default btn-sm btn-block">Button 2</button> </div>
  89. 89. Bootstrap Button 3. Active/Disabled Buttons • A button can be set to an active (appear pressed) or a disabled (unclickable) state • The class .active makes a button appear pressed, and the class .disabled makes a button unclickable.
  90. 90. <div class="container"> <h2>Button States</h2> <button type="button" class="btn btn-primary">Primary Button</button> <button type="button" class="btn btn-primary active">Active Primary</button> <button type="button" class="btn btn-primary disabled">Disabled Primary</button> </div>
  91. 91. Bootstrap Button Groups • Bootstrap allows you to group a series of buttons together (on a single line) in a button group.
  92. 92. Example……. <!DOCTYPE html> <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.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/ 3.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3 .3.7/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <h2>Button Group</h2> <p>The .btn-group class creates a button group:</p> <div class="btn-group"> <button type="button" class="btn btn- primary">Apple</button> <button type="button" class="btn btn- primary">Samsung</button> <button type="button" class="btn btn- primary">Sony</button> </div> </div> </body> </html>
  93. 93. Output
  94. 94. NOTE: Instead of applying button sizes to every button in a group, use class .btn-group- lg|sm|xs to size all buttons in the group.
  95. 95. Example…. <div class="container"> <h2>Button Groups - Set Sizes</h2> <p>Add class .btn-group-* to size all buttons in a button group.</p> <h3>Large Buttons:</h3> <div class="btn-group btn-group- lg"> <button type="button" class="btn btn-primary">Apple</button> <button type="button" class="btn btn-primary">Samsung</button> <button type="button" class="btn btn-primary">Sony</button> </div> <h3>Default Buttons:</h3> <div class="btn-group"> <button type="button" class="btn btn-primary">Apple</button> <button type="button" class="btn btn-primary">Samsung</button> <button type="button" class="btn btn-primary">Sony</button> </div> h3>Small Buttons:</h3> <div class="btn-group btn-group- sm"> <button type="button" class="btn btn-primary">Apple</button> <button type="button" class="btn btn-primary">Samsung</button> <button type="button" class="btn btn-primary">Sony</button> </div>
  96. 96. Output:
  97. 97. Vertical Button Groups example… <div class="container"> <h2>Vertical Button Group</h2> <p>Use the .btn-group-vertical class to create a vertical button group:</p> <div class="btn-group-vertical"> <button type="button" class="btn btn-primary">Apple</button> <button type="button" class="btn btn-primary">Samsung</button> <button type="button" class="btn btn-primary">Sony</button> </div> </div>
  98. 98. Justified Button Groups • Note: For <button> elements, you must wrap each button in a .btn-group class
  99. 99. Example….. <div class="container"> <h2>Justified Button Groups</h2> <div class="btn-group btn-group- justified"> <div class="btn-group"> <button type="button" class="btn btn- primary">Apple</button> </div> <div class="btn-group"> <button type="button" class="btn btn- primary">Samsung</button> </div> <div class="btn-group"> <button type="button" class="btn btn-primary">Sony</button> </div> </div> </div>
  100. 100. Nesting Button Groups & Dropdown Menus <div class="container"> <h2>Nesting Button Groups</h2> <p>Nest button groups to create drop down menus:</p> <div class="btn-group"> <button type="button" class="btn btn- primary">Apple</button> <button type="button" class="btn btn- primary">Samsung</button> <div class="btn-group"> <button type="button" class="btn btn- primary dropdown-toggle" data- toggle="dropdown"> Sony <span class="caret"></span></button> <ul class="dropdown-menu" role="menu"> <li><a href="#">Tablet</a></li> <li><a href="#">Smartphone</a></li> </ul> </div>
  101. 101. Split Button Dropdowns <div class="container"> <h2>Split Buttons</h2> <div class="btn-group"> <button type="button" class="btn btn-primary">Sony</button> <button type="button" class="btn btn-primary dropdown-toggle" data- toggle="dropdown"> <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu"> <li><a href="#">Tablet</a></li> <li><a href="#">Smartphone</a></li> </ul> </div> </div>
  102. 102. Glyphicons • Bootstrap provides 260 glyphicons from the Glyphicons Halflings set. • Glyphicons can be used in text, buttons, toolbars, navigation, forms, etc. • Syntax: • <span class="glyphicon glyphicon-name"></span>
  103. 103. Example…. <div class="container"> <h2>Glyphicon Examples</h2> <p>Envelope icon: <span class="glyphicon glyphicon- envelope"></span></p> <p>Envelope icon as a link: <a href="#"><span class="glyphicon glyphicon-envelope"></span></a> </p> <p>Search icon: <span class="glyphicon glyphicon- search"></span></p> <p>Search icon on a button: <button type="button" class="btn btn- default"> <span class="glyphicon glyphicon- search"></span> Search </button> </p> <p>Search icon on a styled button: <button type="button" class="btn btn- info"> <span class="glyphicon glyphicon- search"></span> Search </button> </p> <p>Print icon: <span class="glyphicon glyphicon-print"></span></p> <p>Print icon on a styled link button: <a href="#" class="btn btn-success btn-lg"> <span class="glyphicon glyphicon print"></span> Print </a> </p> </div>
  104. 104. Output
  105. 105. Bootstrap Progress Bars Progress Bar With Label <div class="container"> <h2>Progress Bar With Label</h2> <div class="progress"> <div class="progress-bar" role="progressbar" aria- valuenow="70" aria-valuemin="0" aria-valuemax="100" style="width:70%"> 70% </div> </div>
  106. 106. Colored Progress Bars • Contextual classes are used to provide "meaning through colors". • The contextual classes that can be used with progress bars are: • .progress-bar-success • .progress-bar-info • .progress-bar-warning • .progress-bar-danger
  107. 107. Example…. <div class="container"> <h2>Colored Progress Bars</h2> <p>The contextual classes colors the progress bars:</p> <div class="progress"> <div class="progress-bar progress-bar-success" role="progressbar" aria- valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width:40%"> 40% Complete (success) </div>
  108. 108. Output
  109. 109. Animated Progress Bar <div class="container"> <h2>Animated Progress Bar</h2> <p>The .active class animates the progress bar:</p> <div class="progress"> <div class="progress-bar progress- bar-striped active" role="progressbar" aria-valuenow="40" aria- valuemin="0" aria-valuemax="100" style="width:40%"> 40% </div>
  110. 110. Stacked Progress Bars <div class="container"> <h2>Stacked Progress Bars</h2> <p>Create a stacked progress bar by placing multiple bars into the same div with class .progress:</p> <div class="progress"> <div class="progress-bar progress-bar-success" role="progressbar" style="width:40%"> Free Space </div> <div class="progress-bar progress-bar- warning" role="progressbar" style="width:10%"> Warning </div> <div class="progress-bar progress-bar-danger" role="progressbar" style="width:20%"> Danger </div> </div>
  111. 111. Bootstrap - Pagination • If you have a web site with lots of pages, you may wish to add some sort of pagination to each page. • A basic pagination in Bootstrap looks like this:
  112. 112. • To create a basic pagination, add the .pagination class to an <ul> element. • <ul class="pagination"> <li><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li><a href="#">5</a></li> </ul>
  113. 113. Active state • The active state shows what is the current page. • Class .active is used to let the user know which page he/she is on.
  114. 114. • <ul class="pagination"> <li><a href="#">1</a></li> <li class="active"><a href="#">2</a> </li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li><a href="#">5</a></li> </ul>
  115. 115. Disabled state • A disabled link cannot be clicked. • Add class .disabled if a link for some reason is disabled.
  116. 116. • <ul class="pagination"> <li><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li class="disabled"><a href="#">4</ a></li> <li><a href="#">5</a></li> </ul>
  117. 117. • Pagination Sizing • Pagination blocks can also be sized to a larger size or a smaller size. • Add class .pagination-lg for larger blocks or .pagination-sm for smaller blocks:
  118. 118. • Breadcrumbs • Another form for pagination, is breadcrumbs. • The .breadcrumb class indicates the current page's location within a navigational hierarchy.
  119. 119. Bootstrap Pager • Pager is also a form of pagination. • Pager provides previous and next buttons (links). • To create previous/next buttons, add the .pager class to an <ul> element:
  120. 120. • Align Buttons • Use the .previous and .next classes to align each button to the sides of the page: • <ul class="pager"> <li class="previous"><a href="#">Previous</a> </li> <li class="next"><a href="#">Next</a></li> </ul>
  121. 121. Bootstrap List Groups • Basic List Groups • The most basic list group is an unordered list with list items:
  122. 122. • To create a basic list group, use an <ul> element with class .list-group, and <li> elements with class .list-group-item: • <ul class="list-group"> <li class="list-group-item">First item</li> <li class="list-group-item">Second item</li> <li class="list-group-item">Third item</li> </ul>
  123. 123. List Group With Badges • You can also add badges to a list group. The badges will automatically be positioned on the right:
  124. 124. • To create a badge, create a <span> element with class .badge inside the list item. • <ul class="list-group"> <li class="list-group- item">New <span class="badge">12</span></li> <li class="list-group- item">Deleted <span class="badge">5</span></li> <li class="list-group- item">Warnings <span class="badge">3</span></li> </ul>
  125. 125. Active & Disabled • Use the .active class to highlight the current item. • To disable an item, use the .disabled class.
  126. 126. • <div class="list-group"> <a href="#" class="list-group-item active">First item</a> <a href="#" class="list-group-item">Second item</a> <a href="#" class="list-group-item">Third item</a> </div>
  127. 127. • <div class="list-group"> <a href="#" class="list-group-item disabled">First item</a> <a href="#" class="list-group-item">Second item</a> <a href="#" class="list-group-item">Third item</a> </div>
  128. 128. Contextual Classes • Contextual classes can be used to color list items:
  129. 129. • The classes for coloring list-items are: .list-group- item-success, list-group-item-info, list-group- item-warning, and .list-group-item-danger. • <ul class="list-group"> <li class="list-group-item list-group-item- success">First item</li> <li class="list-group-item list-group-item- info">Second item</li> <li class="list-group-item list-group-item- warning">Third item</li> <li class="list-group-item list-group-item- danger">Fourth item</li> </ul>
  130. 130. Bootstrap Dropdown • A dropdown menu is a toggleable menu that allows the user to choose one value from a predefined list.
  131. 131. Example • <div class="dropdown"> <button class="btn btn-primary dropdown- toggle" type="button" data- toggle="dropdown">Dropdown Example <span class="caret"></span></button> <ul class="dropdown-menu"> <li><a href="#">HTML</a></li> <li><a href="#">CSS</a></li> <li><a href="#">JavaScript</a></li> </ul> </div>
  132. 132. • The .dropdown class indicates a dropdown menu. • To open the dropdown menu, use a button or a link with a class of .dropdown-toggle and the data-toggle="dropdown" attribute. • The .caret class creates a caret arrow icon, which indicates that the button is a dropdown. • Add the .dropdown-menu class to a <ul> element to actually build the dropdown menu.
  133. 133. Dropdown Divider • The .divider class is used to separate links inside the dropdown menu with a thin horizontal border: • <li class="divider"></li>
  134. 134. Dropdown Header • The .dropdown-header class is used to add headers inside the dropdown menu: • <li class="dropdown-header">Dropdown header 1</li>
  135. 135. • Dropdown Position • <ul class="dropdown-menu dropdown-menu- right"> • Dropup • If you want the dropdown menu to expand upwards instead of downwards, change the <div> element with class="dropdown" to "dropup":
  136. 136. Bootstrap Tabs and Pills • Bootstrap provides an easy and quick way to create basic nav components like tabs and pills which are very flexible and elegant. All the Bootstrap's nav components—tabs and pills—share the same base markup and styles through the base .nav class. • Tabs are created with <ul class="nav nav-tabs“
  137. 137. Bootstrap Tabs • Tabs can also hold dropdown menus. • You can also add icons to your tabs to make it more attractive.
  138. 138. <!DOCTYPE html><head> <title>Bootstrap Case</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.3.7/css/bootstrap.m in.css"> <script src="https://ajax.googleapis.com/aja x/libs/jquery/3.1.1/jquery.min.js">< /script><scriptsrc="https://maxcdn. bootstrapcdn.com/bootstrap/3.3.7/js /bootstrap.min.js"></script> </head> <body> <div class="container"> <ul class="nav nav-tabs"> <li class="dropdown"> <a class="dropdown-toggle" data- toggle="dropdown" href="#">Menu 1 <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Submenu 1- 1</a></li> <li><a href="#">Submenu 1- 2</a></li> <li><a href="#">Submenu 1- 3</a></li> </ul> </li> <div class="bs-example"> <ul class="nav nav-tabs"><li class="active"> <a href="#"> <span class="glyphicon glyphicon- home"></span> Home</a></li> <li><a href="#"><span class="glyphicon glyphicon- user"></span> Profile</a></li> <li><a href="#"><span class="glyphicon glyphicon- envelope"></span> Messages</a></li>
  139. 139. Bootstrap Pills • Similarly you can create a basic pill based navigation using the base class .nav-pills instead of .nav-tabs, without any further change in markup.
  140. 140. Bootstrap Pills • Stacked Pills Nav Pills navigations are horizontal by default. To make them appear vertically stacked, just add an extra class .nav-stacked to the <ul> element.
  141. 141. <!DOCTYPE html><head> <title>Bootstrap Case</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.3.7/css/bootstrap.m in.css"> <script src="https://ajax.googleapis.com/aja x/libs/jquery/3.1.1/jquery.min.js">< /script> <script src="https://maxcdn.bootstrapcdn.c om/bootstrap/3.3.7/js/bootstrap.min. js"></script> </head> <div class="container"> <h3>Vertical Pills With Dropdown Menu</h3> <ul class="nav nav-pills nav- stacked"> <li class="active"><a href="#">Home</a></li> <li class="dropdown"> <a class="dropdown-toggle" data- toggle="dropdown" href="#">Menu 1 <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Submenu 1- 1</a></li> <li><a href="#">Submenu 1- 2</a></li> <li><a href="#">Submenu 1- 3</a></li> </ul></li>
  142. 142. Bootstrap Forms Bootstrap provides three types of form layouts: • Vertical form (this is default) • Horizontal form • Inline form
  143. 143. Bootstrap Forms • Creating Vertical Form Layout This is the default Bootstrap form layout in which styles are applied to form controls without adding any base class to the <form> element or any large changes in the markup.
  144. 144. <!DOCTYPE html><head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn. com/bootstrap/3.3.7/css/bootstrap.m in.css"> <script src="https://ajax.googleapis.com/aja x/libs/jquery/3.1.1/jquery.min.js">< /script> <script src="https://maxcdn.bootstrapcdn.c om/bootstrap/3.3.7/js/bootstrap.min. js"></script> </head> <body> <div class="container"> <h2>Vertical (default) form</h2> <div class="form-group"> <label for="email">Email:</label> <input type="email" class="form- control" id="email" placeholder="Enter email"> </div> <div class="form-group"> <label for="pwd">Password:</label> <input type="password" class="form-control" id="pwd" placeholder="Enter password"></div> <div class="checkbox"> <label><input type="checkbox"> Remember me</label> </div> <button type="submit" class="btn btn- default">Submit</button>
  145. 145. Bootstrap Forms • Creating Inline Form Layout Sometimes you might require to place the form controls side-by-side to compact the layout. You can do this easily by adding the Bootstrap class .form-inline to the <form> element.
  146. 146. <!DOCTYPE html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn. com/bootstrap/3.3.7/css/bootstrap.m in.css"> <script src="https://ajax.googleapis.com/aja x/libs/jquery/3.1.1/jquery.min.js">< /script> <script src="https://maxcdn.bootstrapcdn.c om/bootstrap/3.3.7/js/bootstrap.min. js"></script> </head> <body> <form class="form-inline"> <div class="form-group"> <label for="email">Email:</label> <input type="email" class="form-control" id="email" placeholder="Enter email"></div> <div class="form-group"> <label for="pwd">Password:</label> <input type="password" class="form-control" id="pwd" placeholder="Enter password"> </div> <div class="checkbox"> <label><input type="checkbox"> Remember me</label></div> <button type="submit"
  147. 147. Bootstrap Forms • Creating Horizontal Form Layout In horizontal form layout labels are right aligned and floated to left to make them appear on the same line as form controls.
  148. 148. <body> <div class="container"> <h2>Horizontal form</h2> <form class="form-horizontal"> <div class="form-group"> <label class="control-label col- sm-2" for="email">Email:</label> <div class="col-sm-10"> <input type="email" class="form-control" id="email" placeholder="Enter email"> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="pwd">Password:</label> <div class="col-sm-10"> <input type="password" class="form-control" id="pwd" placeholder="Enter password"></div> </div> <div class="form-group"> <div class="col-sm-offset-2 col- sm-10"> <div class="checkbox"> <label><input type="checkbox"> Remember me</label> </div></div></div> <div class="form-group"> <div class="col-sm-offset-2 col- sm-10"> <button type="submit" class="btn btn- default">Submit</button> </div> </div> </form> </div> </body> </html>
  149. 149. Bootstrap Form Inputs • Bootstrap natively supports the most common form controls mainly input, textarea, checkbox, radio, and select. • The most common form text field is the input field. This is where users will enter most of the essential form data. Bootstrap offers support for all native HTML5 input types: text, password, datetime, datetime-local, date, month, time, week, number, email, url, search, tel, and color. Proper type declaration is required to make Inputs fully styled.
  150. 150. Bootstrap Form Inputs Inputs <form role = "form"> <div class = "form-group"> <label for = "name">Label</label> <input type = "text" class = "form-control" placeholder = "Text input"> </div> </form>
  151. 151. Bootstrap Form Inputs Text area <form role = "form"> <div class = "form-group"> <label for = "name">Text Area</label> <textarea class = "form-control" rows = "3"></textarea> </div> </form>
  152. 152. Bootstrap Form Inputs Checkboxes <form> <div class="checkbox"> <label><input type="checkbox" value="">Option 1</label> </div> <div class="checkbox"><label> <input type="checkbox" value="">Option 2</label> </div> <div class="checkbox disabled"> <label><input type="checkbox" value="" disabled>Option 3</label> </div> </form>
  153. 153. Bootstrap Form Inputs Radio Buttons <form> <div class="radio"><label><input type="radio" name="optradio">Option 1</label></div> <div class="radio"><label><input type="radio" name="optradio">Option 2</label> </div><div class="radio disabled"> <label><input type="radio" name="optradio" disabled>Option 3</label> </div></form>
  154. 154. Bootstrap Form Inputs Select List <form> <div class="form-group"> <label for="sel1">Select list (select one):</label> <select class="form-control" id="sel1"> <option>1</option> <option>2</option> <option>3</option> <option>4</option></select> </div> </form>
  155. 155. Bootstrap Media Object • If you want to create a layout that contains left- or right- aligned media object like images or video alongside the textual content such as blog comments, Tweets, etc. • Use a <div> element with the .media class to create a container for media objects. • Use the .media-left class to align the media object (image) to the left, or the .media-right class to align it to the right. • Text that should appear next to the image, is placed inside a container with class="media-body". • Additionally, you can use .media-heading for headings.
  156. 156. <div class="container"> <h2>Media Object</h2> <p>The media object can also be top, middle or bottom-aligned with the "media-top", "media-middle" or "media-bottom" class:</p><br> <div class="media"> <div class="media-left media-top"> <img src="img_avatar1.png" class="media-object" style="width:80px"> </div> <div class="media-body"> <h4 class="media-heading">Media Top</h4> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
  157. 157. <div class="media"> <div class="media-left media-middle"> <img src="img_avatar1.png" class="media-object" style="width:80px"> </div> <div class="media-body"> <h4 class="media-heading">Media Middle</h4> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p></div> </div> <hr>
  158. 158. <div class="media"> <div class="media-left media-bottom"> <img src="img_avatar1.png" class="media-object" style="width:80px"> </div> <div class="media-body"> <h4 class="media-heading">Media Bottom</h4> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> </div> </div> </div>
  159. 159. Bootstrap Media Object
  160. 160. THANK YOU

×