Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 4 Bootstrap. Content Bootstrap with CSS Bootstrap Layout Components Bootstrap Plugins.

Similar presentations


Presentation on theme: "Chapter 4 Bootstrap. Content Bootstrap with CSS Bootstrap Layout Components Bootstrap Plugins."— Presentation transcript:

1 Chapter 4 Bootstrap

2 Content Bootstrap with CSS Bootstrap Layout Components Bootstrap Plugins

3 Bootstrap with CSS Grid System Typography Tables Forms Buttons Images Helper Classes Responsive utilities

4 Grid System Working of Bootstrap Grid System: – Rows must be placed within a.container class for proper alignment and padding. – Use rows to create horizontal groups of columns. – Content should be placed within the columns, and only columns may be the immediate children of rows. – Columns create gutters (gaps between column content) via padding. That padding is offset in rows for the first and the last column via negative margin on.rows. – Grid columns are created by specifying the number of twelve available columns you wish to span. For example, three equal columns would use three.col-xs-4. Class for help grid system: –.clearfix –.col-md-offset-* –.row –.col-md-push-* –.col-md-pull-*

5 Grid options Extra small devices Phones (<768px) Small devices Tablets (≥768px) Medium devices Desktops (≥992px) Large devices Desktops (≥1200px) Grid behavior Horizontal at all times Collapsed to start, horizontal above breakpoints Max container width None (auto)750px970px1170px Class prefix.col-xs-.col-sm-.col-md-.col-lg- # of columns12 Max column widthAuto60px78px95px Gutter width 30px (15px on each side of a column) 30px (15px on each side of a column) 30px (15px on each side of a column) 30px (15px on each side of a column) NestableYes OffsetsYes Column orderingYes

6 Typography Using typography feature of Bootstrap you can create headings, paragraphs, lists and other inline elements. Typography: – Headings: using H1..6 – Inline Subheadings: using tag in tag. – Lead Body(. lead): It give you a larger font size, lighter weight, and a taller line height. – Emphasis: using. text-left,.text-center,.text-right,.text-muted,.text-primary,.text-success,.text-info,.text-warning,.text- danger – Addresses – Blockquotes: using tag and class.pull-right – Lists: using Ordered lists, Unordered lists with class (.list- unstyled,.list-inline), Definition lists (, elements).

7 Tables Table Class: –.table –.table-striped –.table-bordered –.table-hover –.table-condensed –.table-responsive

8 Forms Bootstrap Form Layout Type: – Vertical (default) form – In-line form – Horizontal form Form Class: –.form-group –.form-control: create form control –.form-inline: for create inline form layout. –.form-horizontal: for create horizontal form layout. –.control-label: fro create label of control. –.checkbox-inline: create inline checkbox. –.radio-inline: create inline radio. –. Checkbox: create checkbox –.form-control-static: for placing plain text next to from label. –.has-warning: validation styles for warnings messages. –.has-error: validation styles for errors messages. –.has-success: validation styles for success messages. –.input-lg –. input-sm

9 Step to create Form Layout Vertical (default) form: – Step 1: Add the parent element. – Step 2: Wrap labels and controls in a with class.form-group. – Step 3: Add a class of.form-control to all textual,, and elements. Inline Form – Add the class.form-inline to the tag. Horizontal Form – Step 1: add a class of.form-horizontal to the parent element. – Step 2: wrap labels and controls in a with class.form-group. – Step3: add a class of.control-label to the labels.

10 Buttons ClassDescription btnDefault/ Standard button. btn-primaryProvides extra visual weight and identifies the primary action in a set of buttons. btn-successIndicates a successful or positive action. btn-infoContextual button for informational alert messages. btn-warningIndicates caution should be taken with this action. btn-dangerIndicates a dangerous or potentially negative action. btn-link Deemphasize a button by making it look like a link while maintaining button behavior..btn-lgThis makes the button size large..btn-smThis makes the button size small..btn-xsThis makes the button size extra small..btn-blockThis creates block level buttons—those that span the full width of a parent..activeTo show that it is activated.. disabled

11 Images Image class: –.img-rounded − adds border-radius:6px to give the image rounded corners. –.img-circle − makes the entire image round by adding border-radius:500px. –.img-thumbnail − adds a bit of padding and a gray border.

12 Helper Classes Helper Class: –.close to get the close icon. –.caret: Use carets to indicate dropdown functionality and direction(with tag). –.pull-left /.pull-right: To float an element to the left or right. –.center-block to set an element to center. –.clearfix To clear the float of any element. –.show /.hidden To force an element to be shown or hidden.

13 Responsive utilities ClassesDevices.visible-xsExtra small (less than 768px) visible.visible-smSmall (up to 768 px) visible.visible-mdMedium (768 px to 991 px) visible.visible-lgLarger (992 px and above) visible.hidden-xsExtra small (less than 768px) hidden.hidden-smSmall (up to 768 px) hidden.hidden-mdMedium (768 px to 991 px) hidden.hidden-lgLarger (992 px and above) hidden.visible-printYes Visible.hidden-printVisible only to browser not to print.

14 Bootstrap Layout Components Glyphicons Dropdowns Button Groups Button Dropdowns Input Groups Navigation Elements Navbar Breadcrumb Pagination Labels and Badges Jumbotron Page Header Thumbnails Alerts List Group Panels Wells

15 Glyphicons What are Glyphicons? Glyphicons are icon fonts which you can use in your web projects. Usage –

16 Dropdowns Dropdown menus are toggleable, contextual menus for displaying links in a list format.This can be made interactive with the dropdown JavaScript plugin. To Create Dropdown just wrap the dropdown menu within the class.dropdown Dropdown class:.dropdown.dropdown-menu.pull-right dropdown-header

17 Button Groups ClassDescriptionCode Sample.btn-group This class is used for a basic button group. Wrap a series of buttons with class.btn in.btn-group. Button1 Button2.btn-toolbar This helps to combine sets of into a for more complex components........btn-group-lg,.btn-group-sm,.btn-group-xs These classes can be applied to button group instead of resizing each button...........btn-group-vertical This class make a set of buttons appear vertically stacked rather than horizontally....

18 Input Groups Using input groups you can easily prepend and append text or buttons to the text-based inputs. Input Group Class: –.input-group –.input-group-addon. –.input-group-lg –.input-group-sm –.input-group-xs Step to create input groups: – Step 1: wrap it in a with class.input-group – Step 2: as a next step, within that same, place your extra content inside a with class.input-group-addon. – Step3: now place this either before or after the element.

19 Navigation Elements Navigation elements class: –.nav –.nav-tabs –.nav-pills –.nav-stacked –.nav-justified Usage: – For create tab

20 Navbar Navbars are responsive 'meta' components that serve as navigation headers for your application or site. To create a default navbar: – Add the classes.navbar,.navbar-default to the tag. – Add role = "navigation" to the above element, to help with accessibility. – Add a header class.navbar-header to the element. Include an element with class navbar-brand. This will give the text a slightly larger size. – To add links to the navbar, simply add an unordered list with the classes of.nav,.navbar-nav. To create Responsive Navbar: – Add the classes.navbar,.navbar-default to the tag. – Add a header class.navbar-header to the element. – Inside tag of navbar-header add button tag with class.navbar-toggle then data-toggle = "collapse" data-target = "#idofmenu“. – Create Menu with tag by use class.collapse.navbar-collapse and id = idofmenu. Navbar Class: –.navbar-form –.navbar-left –.navbar-btn –.navbar-text: This is usually used with tag for proper leading and color. –.navbar-link to add proper colors for the default and inverse navbar options. –.navbar-left: can align the components like nav links, forms, buttons, or text to left. –.navbar-right: can align the components like nav links, forms, buttons, or text to right. –.navbar-fixed-top –.navbar-fixed-bottom –.navbar-static-top –.navbar-inverse

21 Breadcrumb Breadcrumbs are a great way to show hierarchy-based information for a site. Example Home 2013 November

22 Pagination Type of Pagination: – Pagination – Pager

23 Pagination ClassDescriptionSample code.pagination Add this class to get the pagination on your page. « 1........disabled,.active You can customize links by using.disabled for unclickable links and.active to indicate the current page. « 1 (current)........pagination-lg,.pagination- sm Use these classes to get different size items..........

24 Pager ClassDescriptionSample code.pager Add this class to get the pager links. Previous Next.previous,.next Use class.previous to left align and.next to right-align the links. ← Older Newer →.disabled Add this class to get a muted look. ← Older Newer →

25 Labels and badges Labels are great for offering counts, tips, or other markup for pages. Label Class: –.label –.label-default –.label-primary –.label-success –.label-info –.label-warning –.label-danger Badges are similar to labels, the primary difference is that the corners are more rounded. Badges class: –. Badge

26 Jumbotron This component can optionally increase the size of headings and add a lot of margin for landing page content. To use the Jumbotron: – Create a container with the class of.jumbotron. – In addition to a larger, the font-weight is reduced to 200px.

27 Page Header The page header is a nice little feature to add appropriate spacing around the headings on a page. To use a page header, wrap your heading in a with a class of.page-header

28 Thumbnails A lot of sites need a way to lay out images, videos, text, etc, in a grid, and Bootstrap has an easy way to do this with thumbnails. To create thumbnails: – Add an tag with the class of.thumbnail around an image. – This adds four pixels of padding and a gray border. – On hover, an animated glow outlines the image. Adding Custom Content – Change the tag that has a class of.thumbnail to a. – Inside of that, you can add anything you need. – If you want to group multiple images, place them in an unordered list, and each list item will be floated to the left.

29 Alerts Alerts provide a way to style messages to the user. To build a dismissal alert: Add a basic alert by creating a wrapper and adding a class of.alert Also add optional.alert-dismissable to the above class. Add a close button by using class.close and attribute data-dismiss = "alert“, aria-hidden = "true".

30 List Group The purpose of list group component is to render complex and customized content in lists. To get a basic list group: – Add the class.list-group to element. – Add class.list-group-item to.

31 Bootstrap Plugins Modal Dropdown Scroll spy Tab Popover Alert Collapse Carousel Affix


Download ppt "Chapter 4 Bootstrap. Content Bootstrap with CSS Bootstrap Layout Components Bootstrap Plugins."

Similar presentations


Ads by Google