[Home] Edit Article
Author Information
File Uploads
Edit Article XML Content
<?xml version="1.0"?> <document> <header> <issuecode> </issuecode> <articlecode> </articlecode> <zone> </zone> <title>Bootstrap 3-What’s It All About?</title> <authors> <author> <name>Jim Duffy</name> <email>jduffy@takenote.com</email> <bio> <p> </p> <p>Jim Duffy is founder and CEO of TakeNote Technologies, an award-winning training, consulting, and software development company specializing in .NET software developer training and helping clients create business solutions with Microsoft enterprise technologies. Jim’s expertise is with .NET technologies, ASP.NET, HTML5, SQL Server, and Visual FoxPro-to-.NET conversions. He has a BS degree in Computer and Information Systems and over 25 years of programming and training experience. He’s an energetic trainer, skilled developer, and has been published in leading developer-oriented publications.</p> <p> </p> <p>Jim is a Microsoft Regional Director, a Microsoft MVP, an ASPInsider, and is an entertaining and popular speaker at regional user groups and international developer conferences.</p> <p> </p> <p>You can find additional information about Jim, TakeNote Technologies, links to his blog, training information, consulting information, and software development services at http://www.takenote.com.</p> </bio> </author> <photo>UNKNOWNIMAGE</photo> <author> <name>Scott Lenck</name> <email>Scott.Lenck@hyperlenck.com</email> <phone> </phone> <bio> <p>Scott Lenck is an application developer at The Walt Disney Company and has been with the company for over 2 years. He graduated with a BS in Computer Science from the University of Central Florida. Scott has a working knowledge of robotics due to his time volunteering to mentor a FIRST (http://www.usfirst.org/) robotics team while attending UCF.</p> </bio> <photo>UNKNOWNIMAGE</photo> </author> </authors> <copyright>2013 - CoDe Magazine and EPS Software Corp.</copyright> <owner>CoDe Magazine</owner> </header> <body> <p id="1">Bootstrap is an incredibly popular open-source toolkit containing CSS, fonts, and JavaScript extensions to help enrich interface components on a website or Web application. The included CSS enhances and extends standard interface controls when accompanied with the calls to certain CSS classes. Fonts from Glyphicons.com are included in the toolkit, with 180 icons that you can use. </p> <p id="2">The JavaScript extensions are in the form of jQuery plug-ins and offer additional interface elements along with extending the functionality of standard interface elements. The toolkit includes the distribution files, templates, examples, and all the source files needed to further develop against the toolkit. Throughout this article, however, I will stick with only the distribution folder.</p> <pullquote>Bootstrap is an incredibly popular open-source toolkit containing CSS, fonts, and JavaScript extensions to help enrich interface components on a website or Web application.</pullquote> <p id="3">Although compatible with the latest versions of all major browsers, Bootstrap has only partial compatibility with some older versions of browsers because the toolkit uses various properties only available with CSS3-enabled browsers. Fortunately, this only affects some of the extensions of the toolkit and doesn’t affect the actual functionality of the interface components themselves.</p> <p id="4">Bootstrap allows richly stylized websites to be seen clearly whether on a desktop computer, tablet, or mobile phone. Due to Bootstrap’s responsive design support, the layout of websites adjusts dynamically based on the characteristics of the device. With this functionality available, the time to create a complete website with full device support is greatly decreased by taking away the need to develop a mobile-only version of the same website.</p> <pullquote>The time to create a complete website with full device support is greatly decreased by taking away the need to develop a mobile-only version of the same website.</pullquote> <p id="5">The following components are some of the core interface components available to use after attaching Bootstrap to a website.</p> <h3>Grid System</h3> <p id="6">One of the most important components within the Bootstrap toolkit, the grid system, allows alignment of columns within divisions with the .row class. Defined by device type (Mobile, Tablet, Desktop) to help customize responsiveness of a website’s layout, the length of these columns in a row must add up to 12. The following example defines a grid of four equal-width columns.</p> <codesnippet> <font color="Blue"><</font>h3<font color="Blue">></font>Four columns<font color="Blue"></</font>h3<font color="Blue">></font></codesnippet> <codesnippet><div»class="row"></codesnippet> <codesnippet>»»»»<div»class="col-md-3">Column»1»content</div></codesnippet> <codesnippet>»»»»<div»class="col-md-3">Column»2»content</div></codesnippet> <codesnippet>»»»»<div»class="col-md-3">Column»3»content</div></codesnippet> <codesnippet>»»»»<div»class="col-md-3">Column»4»content</div></codesnippet> <codesnippet></div></codesnippet> <p id="7">Described in detail later in this article, the grid system underwent a major update in Bootstrap 3.0.</p> <h3>Typography</h3> <p id="8">Bootstrap adds functionality to already-existing HTML text-based controls but also adds additional text-based controls to enhance the way text is displayed. The added text-based controls contained in the toolkit allow modification of font styles and, although the usability of HTML-based counterparts doesn’t change, it’s recommended to use these new font controls so that Bootstrap can style them properly. In addition, Bootstrap includes classes to emphasize text using color and to align text within a text control. </p> <p id="9">The following example, demonstrated by <b>Figure 1</b>, shows some of these additional controls and classes to emphasize and align text in different ways.</p> <figure id="1" src="Figure_01.tif"> <b>Figure 1: </b>You can use color and alignment to emphasize text. </figure> <codesnippet> <font color="Blue"><!</font> <font color="Green">--»Font»Emphasis»--</font> <font color="Blue">></font> </codesnippet> <codesnippet> <font color="Blue"><</font>small<font color="Blue">></font>Fine»print»text»<font color="Blue"></</font>small<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>strong<font color="Blue">>»</font>Bold»text»<font color="Blue"></</font>strong<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>em<font color="Blue">>»</font>Italicized»text<font color="Blue"></</font>em<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><!</font> <font color="Green">--»Color»Emphasis»--</font> <font color="Blue">></font> </codesnippet> <codesnippet> <font color="Blue"><</font>p»<font color="Red">class</font><font color="Blue">="text-muted"></font>Muted»text<font color="Blue"></</font>p<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>p»<font color="Red">class</font><font color="Blue">="text-primary"></font>Primary»text<font color="Blue"></</font>p<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>p»<font color="Red">class</font><font color="Blue">="text-success"></font>Success»Text<font color="Blue"></</font>p<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>p»<font color="Red">class</font><font color="Blue">="text-info"></font>Info»Text<font color="Blue"></</font>p<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>p»<font color="Red">class</font><font color="Blue">="text-warning"></font>Warning»Text<font color="Blue"></</font>p<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>p»<font color="Red">class</font><font color="Blue">="text-danger"></font>Danger»Text<font color="Blue"></</font>p<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><!</font> <font color="Green">--»Text»Alignment»--</font> <font color="Blue">></font> </codesnippet> <codesnippet> <font color="Blue"><</font>p»<font color="Red">class</font><font color="Blue">="text-left"></font>Left»aligned»text.<font color="Blue"></</font>p<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>p»<font color="Red">class</font><font color="Blue">="text-center"></font>Center»aligned»text.<font color="Blue"></</font>p<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>p»<font color="Red">class</font><font color="Blue">="text-right"></font>Right»aligned»text.<font color="Blue"></</font>p<font color="Blue">></font></codesnippet> <h3>Form</h3> <p id="10">The form-related classes within Bootstrap allow clean grouping and styling when requesting data entry from the end user. The toolkit contains three form types: basic, horizontal, and inline. </p> <p id="11">In a basic form, all form-based input controls have a width of 100% and can be grouped together for optimal white spacing within the group. Unlike the basic form, using the horizontal form makes the description label and the input control exist on the same line. Condensed into a single line, an inline form is optimal for use when real estate on a website is scarce. The example in <b>Listing 1 </b>uses the horizontal form and the result can be seen in <b>Figure 2</b>.</p> <figure id="2" src="Figure_02.tif"> <b>Figure 2: </b>Horizontal forms provide a quick and consistent way to create data entry screens.</figure> <h3>Buttons</h3> <p id="12">Bootstrap supplies stylized buttons to help differentiate the actions of multiple buttons that may appear on a website. To use the button functionality, the class property within an HTML button tag must contain the .btn class along with a desired button style type and an optional button size. The example in <b>Listing 2 </b>shows a variety of examples using the different style and sizes demonstrated in <b>Figure 3</b>.</p> <figure id="3" src="Figure_03.tif"> <b>Figure 3: </b>Bootstrap’s button functionality makes quick work of adding buttons to your forms. </figure> <h3>Images</h3> <p id="13">Bootstrap’s image formatting classes help display images in different layout styles. The following example shows the Bootstrap logo on a page as a rectangle with rounded corners, as a circle, and as a thumbnail. This example is exhibited within a browser in <b>Figure 4</b>. </p> <figure id="4" src="Figure_04.tif"> <b>Figure 4: </b>You can display images using one of the three the image classes.</figure> <codesnippet> <font color="Blue"><</font>img»<font color="Red">src</font><font color="Blue">="bootstrap.png"»</font><font color="Red">class</font><font color="Blue">="img-rounded"></font></codesnippet> <codesnippet> <font color="Blue"><</font>img»<font color="Red">src</font><font color="Blue">="bootstrap.png"»</font><font color="Red">class</font><font color="Blue">="img-circle"></font></codesnippet> <codesnippet> <font color="Blue"><</font>img»<font color="Red">src</font><font color="Blue">="bootstrap.png"»</font><font color="Red">class</font><font color="Blue">="img-thumbnail"></font></codesnippet> <h3>Glyphicons</h3> <p id="14">The 180 icons from Glyphicons provide a professional look and feel across your site. Icons are specified by class and can be used anywhere plain text appears. Demonstrated in <b>Figure 5</b>, the following code displays a variety of icon buttons.</p> <figure id="5" src="Figure_05.tif"> <b>Figure 5: </b>Icons can be used within text, buttons, or anywhere else you want to display one.</figure> <codesnippet><button»<font color="Red">type</font>=<font color="Blue">"button"»</font><font color="Red">class</font>=<font color="Blue">"btn»btn-default"</font>></codesnippet> <codesnippet>»»<span»<font color="Red">class</font>=<font color="Blue">"glyphicon»glyphicon-tag"</font>></span></codesnippet> <codesnippet>»»Tag</codesnippet> <codesnippet></button></codesnippet> <codesnippet><button»<font color="Red">type</font>=<font color="Blue">"button"»</font><font color="Red">class</font>=<font color="Blue">"btn»btn-default"</font>></codesnippet> <codesnippet>»»<span»<font color="Red">class</font>=<font color="Blue">"glyphicon»glyphicon-stop"</font>></span></codesnippet> <codesnippet>»»Stop</codesnippet> <codesnippet></button></codesnippet> <codesnippet><button»<font color="Red">type</font>=<font color="Blue">"button"»</font><font color="Red">class</font>=<font color="Blue">"btn»btn-default"</font>></codesnippet> <codesnippet>»»<span»<font color="Red">class</font>=<font color="Blue">"glyphicon»glyphicon-gift"</font>></span></codesnippet> <codesnippet>»»Gift</codesnippet> <codesnippet></button></codesnippet> <h3>Navs</h3> <p id="15">Used to help with creation of menus, calling .nav classes within unordered lists can occur in one of two ways: tabs or pills. Called within the list items in the unordered lists, active and disabled classes allow for additional interface functionality of a Nav control. Displayed in <b>Figure 6</b>, the following example shows the difference between tab and pill Navs along with the active and disable functionality of the list items.</p> <figure id="6" src="Figure_06.tif"> <b>Figure 6: </b>You can use navs and pills to implement site navigation features </figure> <codesnippet> <font color="Blue"><</font>ul»<font color="Red">class</font><font color="Blue">="nav»nav-tabs"></font></codesnippet> <codesnippet>»»<font color="Blue"><</font>li»<font color="Red">class</font><font color="Blue">="active"><</font>a»<font color="Red">href</font><font color="Blue">="#"></font>Home<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></codesnippet> <codesnippet>»»<font color="Blue"><</font>li<font color="Blue">><</font>a»<font color="Red">href</font><font color="Blue">="#"></font>Help<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></codesnippet> <codesnippet>»»<font color="Blue"><</font>li»<font color="Red">class</font><font color="Blue">="disabled"><</font>a»<font color="Red">href</font><font color="Blue">="#"></font>Dropdown<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>ul<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>ul»<font color="Red">class</font><font color="Blue">="nav»nav-pills"></font></codesnippet> <codesnippet>»»<font color="Blue"><</font>li»<font color="Red">class</font><font color="Blue">="active"><</font>a»<font color="Red">href</font><font color="Blue">="#"></font>Home<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></codesnippet> <codesnippet>»»<font color="Blue"><</font>li<font color="Blue">><</font>a»<font color="Red">href</font><font color="Blue">="#"></font>Help<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></codesnippet> <codesnippet>»»<font color="Blue"><</font>li»<font color="Red">class</font><font color="Blue">="disabled"><</font>a»<font color="Red">href</font><font color="Blue">="#"></font>Dropdown<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>ul<font color="Blue">></font></codesnippet> <h3>Drop-Down Menus</h3> <p id="16">Bootstrap allows for any type of menu to include a drop-down menu. These drop-down menus help group together similar menu items into a single list. To build on the Nav code example, the following example changes the disabled menu item into a drop-down menu. </p> <codesnippet> <font color="Blue"><</font>ul»<font color="Red">class</font><font color="Blue">="nav»nav-tabs"></font></codesnippet> <codesnippet>»»<font color="Blue"><</font>li»<font color="Red">class</font><font color="Blue">="active"><</font>a»<font color="Red">href</font><font color="Blue">="#"></font>Home<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></codesnippet> <codesnippet>»»<font color="Blue"><</font>li<font color="Blue">><</font>a»<font color="Red">href</font><font color="Blue">="#"></font>Help<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></codesnippet> <codesnippet>»»<font color="Blue"><</font>li»<font color="Red">class</font><font color="Blue">="dropdown"></font></codesnippet> <codesnippet>»»»»<font color="Blue"><</font>a»<font color="Red">class</font><font color="Blue">="dropdown-toggle"»</font></codesnippet> <codesnippet>»»»»»»<font color="Red">data-toggle</font><font color="Blue">="dropdown"»</font><font color="Red">href</font><font color="Blue">="#"></font></codesnippet> <codesnippet>»»»»»»Dropdown»<font color="Blue"><</font>span»<font color="Red">class</font><font color="Blue">="caret"></</font>span<font color="Blue">></font></codesnippet> <codesnippet>»»»»<font color="Blue"></</font>a<font color="Blue">></font></codesnippet> <codesnippet>»»»»<font color="Blue"><</font>ul»<font color="Red">class</font><font color="Blue">="dropdown-menu"></font></codesnippet> <codesnippet>»»»»»»<font color="Blue"><</font>li<font color="Blue">><</font>a»<font color="Red">href</font><font color="Blue">="#"></font>Item»1<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></codesnippet> <codesnippet>»»»»»»<font color="Blue"><</font>li<font color="Blue">><</font>a»<font color="Red">href</font><font color="Blue">="#"></font>Item»2<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></codesnippet> <codesnippet>»»»»<font color="Blue"></</font>ul<font color="Blue">></font></codesnippet> <codesnippet>»»<font color="Blue"></</font>li<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>ul<font color="Blue">></font></codesnippet> <p id="17">To allow for the drop-down menu to work properly, placement of the following JavaScript code needs to occur below the location of bootstrap.js file referenced in the webpage:</p> <codesnippet> <font color="Blue"><</font>script<font color="Blue">></font></codesnippet> <codesnippet>»»$('.dropdown-toggle').dropdown()</codesnippet> <codesnippet> <font color="Blue"></</font>script<font color="Blue">></font></codesnippet> <p id="18"> <b>Figure 7 </b>displays the previous code example for a dropdown within the Nav menu.</p> <figure id="7" src="Figure_07.tif"> <b>Figure 7: </b>You can use Drop Downs to group menu items together.</figure> <h3>Modals</h3> <p id="19">The Modal functionality included with Bootstrap allows users to perform an action, such as a button click, to display an interactive dialog box. Any type of functionality can be populated into this dialog box. Whether it contains a form control, simple text, or any other types of controls, Modals provide a sleek form of workflow through a website. <b>Listing 3 </b>displays the code of the modal seen in <b>Figure 8</b>.</p> <figure id="8" src="Figure_08.tif"> <b>Figure 8: </b>Use modals to control workflow though your site.</figure> <p id="20">Now, take a look at some of the differences between Bootstrap 2.x and Bootstrap 3.</p> <h2>Bootstrap 3: Change Has Arrived</h2> <p id="21">Bootstrap 3.0 introduces significant changes. Some of these changes are more impactful than others but nonetheless, you will be doing some work to upgrade your site from a prior version of Bootstrap. Bootstrap 3 is a full-point upgrade, so don’t expect to drop in the new style sheet and JavaScript files and have everything work as expected. It won’t. </p> <p id="22">Fortunately, there are a number of resources on the Web to help with an automatic migration-but I’m getting ahead of myself. Let’s start with a look at what’s new and how it will impact your existing Bootstrap sites.</p> <pullquote>Bootstrap 3 is a full-point upgrade, so don’t expect to drop in the new CSS and JavaScript files and have everything work as expected. It won’t.</pullquote> <h3>Mobile First</h3> <p id="23">The most significant change isn’t a technical one but a change in design perspective. Bootstrap 3 adopts the “mobile first” responsive Web design practice as the overriding theme throughout the framework. </p> <p id="24">Mobile first means exactly what is says. It’s a paradigm shift that focuses on designing the user interface for smaller mobile screens before designing it for larger desktop screens. Instead of trying to take a desktop design and shrink, squeeze, and compress it down for mobile screens, mobile first flips things around and does the exact opposite. You have limited real estate on a smart phone screen, so mobile first makes you focus on the design that puts the most critical and important content on that small screen. As the screen size increases, to a tablet screen, for example, your design grows and begins to accommodate more content and information. As the screen size maxes out on a large desktop screen, your design accommodates all the content and information for the page. Adopting the mobile first approach means no longer having to make desktop and mobile versions of the same page.</p> <pullquote>Mobile first means exactly what is says. It’s a paradigm shift that focuses on designing the user interface for smaller mobile screens before designing it for larger desktop screens.</pullquote> <p id="25">Although embracing the mobile first approach is new in Bootstrap 3, responsive design features exist in prior versions of Bootstrap but they required adding the bootstrap-responsive.css file. That requirement goes away with Bootstrap 3 because all responsive classes and styles are included in the core bootstrap.css file. This means that Web page elements like textboxes, paragraphs, buttons, images, and so on automatically scale based on the size of the viewing area from small smartphone screens, to mini- and full-size tablets, to larger desktop monitors. Before you ask, yes, you can disable the responsive capabilities if you need to build a fixed-width page.</p> <h3>Getting Bootstrap 3</h3> <p id="26">The getting started page (http://getbootstrap.com/getting-started/) offers a few different ways to get Bootstrap 3. The easiest is to download the compiled and minified version, which includes the CSS, JavaScript, and fonts. You can also download the latest source files from GitHub or Clone/fork your own version from GitHub.</p> <h3>Getting Your Pages Ready for Bootstrap 3</h3> <p id="27">All you need to do is add a viewport meta tag to your <head> tag to make sure rendering and touch zooming works properly.</p> <codesnippet><meta»<font color="Red">name</font>="viewport"»</codesnippet> <codesnippet>»»»»<font color="Red">content</font>="width=device-width,»initial-scale=1.0"></codesnippet> <h3>Using the New Grid</h3> <p id="28">The new grid system stands out as the most obvious change in Bootstrap 3 so I’ll start with that first. Gone are the days of working with the grid in either fixed-width column mode or in a fluid, responsive mode. The new grid is fluid, mobile first-centric and percent-based. This means that instead of working with a fixed-width grid (940 pixels), you now work with a grid that is designed with a mobile-based layout and then scale everything out from there.</p> <p id="29">Let’s take a look at the changes you need to make in your HTML code. In prior versions, rows were specified with the .row class or .row-fluid class for fluid grids and columns that you defined with a span* class prefix. Twelve was-and still is-the magic number that the span classes had to add up to.</p> <codesnippet><!-- Bootstrap 2 --></codesnippet> <codesnippet><div <font color="Red">class</font>="<font color="Blue">row</font>"></codesnippet> <codesnippet> <div <font color="Red">class</font>="<font color="Blue">span4</font>">One</div></codesnippet> <codesnippet> <div <font color="Red">class</font>="<font color="Blue">span8</font>">Two</div></codesnippet> <codesnippet></div></codesnippet> <codesnippet> </codesnippet> <codesnippet><div <font color="Red">class</font>="<font color="Blue">row-fluid</font>"></codesnippet> <codesnippet> <div <font color="Red">class</font>="<font color="Blue">span6</font>">Three</div></codesnippet> <codesnippet> <div <font color="Red">class</font>="<font color="Blue">span6</font>">Four</div></codesnippet> <codesnippet></div></codesnippet> <p id="30">The Bootstrap 3 grid is 100% fluid and only requires the use of the .row class. The 12-column structure from prior versions remains the same but the columns are not fixed width. Instead of a span* prefix on column classes, you now use one of four new device-specific column class prefixes. These new column classes provide support for smart phones, tablet, desktops, and large desktops. <b>Table 1 </b>lists grid options for each screen size including container width, maximum column width, and the CSS class prefix to use with each.</p> <p id="31">Let’s take a look at a sample grid with three columns of equal width. The columns are defined with the .col-md- class prefix so the columns appear across the page for screens 970 pixels or wider, and stacked on smaller devices.</p> <codesnippet><!-- Bootstrap 3 --></codesnippet> <codesnippet> <font color="Blue"><</font>h3<font color="Blue">></font>Three columns<font color="Blue"></</font>h3<font color="Blue">></font></codesnippet> <codesnippet><div»class="<font color="Blue">row</font>"></codesnippet> <codesnippet>»»»»<div»class="<font color="Blue">col-md-4</font>">.col-md-4</div></codesnippet> <codesnippet>»»»»<div»class="<font color="Blue">col-md-4</font>">.col-md-4</div></codesnippet> <codesnippet>»»»»<div»class="<font color="Blue">col-md-4</font>">.col-md-4</div></codesnippet> <codesnippet></div></codesnippet> <p id="32"> <b> </b> </p> <p id="33"> <b>Figure 9 </b>demonstrates how the above code looks in a desktop browser.</p> <figure id="9" src="Figure_09.tif"> <b>Figure 9: </b>Grid columns display horizontally on wide screens.</figure> <p id="34"> <b> </b> </p> <p id="35"> <b>Figure 10 </b>displays how the same code looks in a smart phone. Notice the lack of gutters on either side of the stacked columns in <b>Figure 10</b>.</p> <figure id="10" src="Figure_10.tif"> <b>Figure 10: </b>Grids columns stack on smart phone screens.</figure> <p id="36">Column offsetting has changed in Bootstrap 3 as well. You will need to replace any offset* class references with the new offset-* classes.</p> <codesnippet><!-- Bootstrap 2 --></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="row"></font></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="span4"></font>...<font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="span3 offset2"></font>...<font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <codesnippet>»</codesnippet> <codesnippet><!-- Bootstrap 3 --></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="row"></font></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="col-md-4"></font>.col-md-4<font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="col-md-4 col-md-offset-4"></font>Offset»column</codesnippet> <codesnippet>»»<font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <p id="37">Nesting columns has changed in Bootstrap 3. Bootstrap 2.x nested columns added up to the number of columns in the hosting span. In the code snippet below, the two nested columns of span6 and span3 add up to the parent row with span9.</p> <codesnippet><!-- Bootstrap 2 --></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="row"></font></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="span9"></font>Level 1 column</codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="row"></font></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="span6"></font>Level 2<font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="span3"></font>Level 2<font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <p id="38">In Bootstrap 3, nested columns need to add up to 12 and not the number of columns in the hosting span like in Bootstrap 2.x. In the code snippet below, the nested columns add up to 12 and not 9 like the Bootstrap 2 code.</p> <codesnippet><!-- Bootstrap 3 --></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="row"></font></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="col-md-9"></font>Level 1</codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="row"></font></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="col-md-6"></font>Level 2<font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="col-md-6"></font>Level 2<font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <h3>More New Pieces and Parts</h3> <p id="39">Bootstrap 3 only has a few truly new components because the focus was primarily on flat and mobile-first design features. There are a number of new classes that implement the mobile-first design paradigm. <b>Table 2 </b>lists the new elements, both components and classes. There are a few new components you will want to familiarize yourself with, specifically the Panel, the List Group, and the Jumbotron.</p> <h3>Panels</h3> <p id="40">Panels are containers to put content in. At their simplest, they apply basic border and padding around your content. <b>Figure 11 </b>gives you an idea of what the new panel does. Panels are implemented with a starting class of .panel, followed by additional type and formatting classes. </p> <figure id="11" src="Figure_11.tif"> <b>Figure 11: </b>Use Panels to group and organize content.</figure> <p id="41">Panels can have a heading and a footer section.</p> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel panel-primary"></font></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel-heading"></font></codesnippet> <codesnippet>»» <font color="Blue"><</font>h3 <font color="Red">class</font><font color="Blue">="panel-title"></font>Panel title<font color="Blue"></</font>h3<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <codesnippet>»»»»<font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel-body"></font>Panel content<font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel-footer"></font>Panel Footer<font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <p id="42">Additional .panel- classes are available to further customize the appearance of the panel component based on the usage type you have in mind.</p> <codesnippet><div <font color="Red">class</font>="<font color="Blue">panel panel-success</font>"></codesnippet> <codesnippet><div <font color="Red">class</font>="<font color="Blue">panel panel-warning</font>"></codesnippet> <codesnippet><div <font color="Red">class</font>="<font color="Blue">panel panel-danger</font>"></codesnippet> <codesnippet><div <font color="Red">class</font>="<font color="Blue">panel panel-info</font>"></codesnippet> <p id="43"> <b>Listing 4 </b>contains the code that created the page you saw in <b>Figure 11</b>.</p> <h3>List Groups</h3> <p id="44">List groups provide a way to display mobile-like lists. You implement them with the .list-group class and associated items of .list-group-item class. </p> <codesnippet><ul <font color="Red">class</font>="<font color="Blue">list-group</font>"></codesnippet> <codesnippet> <li <font color="Red">class</font>="<font color="Blue">list-group-item</font>">Microsoft</li></codesnippet> <codesnippet> <li <font color="Red">class</font>="<font color="Blue">list-group-item»active</font>">Google</li></codesnippet> <codesnippet> <li <font color="Red">class</font>="<font color="Blue">list-group-item</font>">Apple</li></codesnippet> <codesnippet> <li <font color="Red">class</font>="<font color="Blue">list-group-item</font>">Amazon</li></codesnippet> <codesnippet></ul></codesnippet> <p id="45"> <b> </b> </p> <p id="46"> <b>Figure 12 </b>gives you an idea of what the new list group component does.</p> <figure id="12" src="Figure_12.tif"> <b>Figure 12: </b>List Groups provide list items to select from. </figure> <p id="47">The badge class adds the ability to add badges to the right of a list group item. </p> <codesnippet><ul <font color="Red">class</font>="<font color="Blue">list-group</font>"></codesnippet> <codesnippet> <li <font color="Red">class</font>="<font color="Blue">list-group-item</font>">Microsoft</codesnippet> <codesnippet>» <span <font color="Red">class</font>="<font color="Blue">badge</font>">37</span></codesnippet> <codesnippet> </li></codesnippet> <codesnippet> <li <font color="Red">class</font>="<font color="Blue">list-group-item</font>">Google</codesnippet> <codesnippet> <span <font color="Red">class</font>="<font color="Blue">badge</font>">25</span></codesnippet> <codesnippet> </li> </codesnippet> <codesnippet></ul></codesnippet> <p id="48"> <b>Figure 13 </b>displays a list group with badges.</p> <figure id="13" src="Figure_13.tif"> <b>Figure 13: </b>Add a Badge to a List Group to provide information about list items. </figure> <p id="49">What would a list be if the items weren’t linked to something else? Anchor tags can be used in place of list items and that means swapping out the unordered list tag for a div tag.</p> <codesnippet><div <font color="Red">class</font>="<font color="Blue">list-group</font>"></codesnippet> <codesnippet> <a <font color="Red">href</font>="<font color="Blue">#</font>" <font color="Red">class</font>="<font color="Blue">list-group-item</font>">Microsoft</codesnippet> <codesnippet> <span <font color="Red">class</font>="<font color="Blue">badge</font>">37</span></codesnippet> <codesnippet> </a></codesnippet> <codesnippet> <a <font color="Red">href</font>="<font color="Blue">#</font>" <font color="Red">class</font>="<font color="Blue">list-group-item</font>">Google</codesnippet> <codesnippet> <span <font color="Red">class</font>="<font color="Blue">badge</font>">25</span></codesnippet> <codesnippet> </a></codesnippet> <codesnippet></div></codesnippet> <p id="50">You are not limited to simple HTML within a list group. Additional classes allow you further customize the contents of each list group with classes to optionally mark a specific item as active, add an item heading, footer, and item text. </p> <codesnippet><div <font color="Red">class</font>="<font color="Blue">list-group</font>"></codesnippet> <codesnippet><a <font color="Red">href</font>="<font color="Blue">#</font>" <font color="Red">class</font>="<font color="Blue">list-group-item active</font>"></codesnippet> <codesnippet> <h2 <font color="Red">class</font>="<font color="Blue">list-group-item-heading</font>">Microsoft</h2></codesnippet> <codesnippet> <p <font color="Red">class</font>="<font color="Blue">list-group-item-text</font>">This is text that»is</codesnippet> <codesnippet>»»»»»»being used to demonstrate list groups.»</p></codesnippet> <codesnippet> <h4 <font color="Red">class</font>="<font color="Blue">list-group-item-footer</font>">This is the </codesnippet> <codesnippet>»»»»»»footer!</h4></codesnippet> <codesnippet></a></codesnippet> <p id="51"> <b>Figure 14 </b>displays a list group which takes advantage of the more complex capabilities of the list group component. <b>Listing 5 </b>displays the code used to create the page in <b>Figure 14</b>.</p> <figure id="14" src="Figure_14.tif"> <b>Figure 14: </b>List Groups can display information beyond a simple list item title. </figure> <h3>Jumbotron</h3> <p id="52">The new .jumbotron class replaces the Bootstrap 2.x .hero unit class. Like the .hero-unit class, you use the .jumbotron class to display highlighted content on your site. Jumbotron differs from the .hero-unit class in that it provides a container class that limits the width of the jumbotron. Omitting the container class causes the jumbotron to span the entire width of your viewport. The following code highlights the difference between the .hero-unit and .jumbotron classes.</p> <codesnippet><!--Bootstrap 2--></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="hero-unit"></font></codesnippet> <codesnippet> <font color="Blue"><</font>h1<font color="Blue">></font>Heading<font color="Blue"></</font>h1<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>p<font color="Blue">><</font>a <font color="Red">class</font><font color="Blue">="btn btn-primary btn-large"></font>Info<font color="Blue"></</font>a<font color="Blue">></</font>p<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <codesnippet>»</codesnippet> <codesnippet><!--Bootstrap 3--></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="jumbotron"></font></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="container"></font></codesnippet> <codesnippet> <font color="Blue"><</font>h1<font color="Blue">></font>This»is»Jumbotron»content!<font color="Blue"></</font>h1<font color="Blue">></font></codesnippet> <codesnippet>» <font color="Blue"><</font>p<font color="Blue">><</font>a <font color="Red">class</font><font color="Blue">="btn btn-primary btn-lg"></font>Info<font color="Blue"></</font>a<font color="Blue">></</font>p<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <h2>Existing Element Updates</h2> <p id="53">The majority of the changes in Bootstrap 3 revolve around the class changes made to support the mobile-first focus and the responsive design paradigm. </p> <h3>Forms</h3> <p id="54">One update in the forms-related classes is that field input controls now default to a width of 100%. This was done to insure that data entry forms look correct on mobile devices. </p> <p id="55">Two new classes, .form-group and .form-control, affect how <input>, <textarea>, and <select> elements are styled. Wrapping them with .form-control sets their width to 100% by default. Wrapping all labels and controls in a .form-group class optimally spaces all the elements.</p> <codesnippet><form <font color="Red">role</font>="<font color="Blue">form</font>"></codesnippet> <codesnippet> <div <font color="Red">class</font>="<font color="Blue">form-group</font>"></codesnippet> <codesnippet> <label <font color="Red">for</font>="<font color="Blue">txtEmail</font>">Email address</label></codesnippet> <codesnippet> <input <font color="Red">type</font>="<font color="Blue">email</font>" <font color="Red">class</font>="<font color="Blue">form-control</font>" </codesnippet> <codesnippet>»»»»»»»<font color="Red">id</font>="<font color="Blue">txtEmail</font>" </codesnippet> <codesnippet>»»»»»»»<font color="Red">placeholder</font>="<font color="Blue">Enter email</font>"></codesnippet> <codesnippet> </div></codesnippet> <p id="56">The new .input-group and .input-group-add-on classes provides the ability to extend text-based form controls by adding text or buttons before, after, or on both sides. <b>Figure 15 </b>gives you an idea of what the .input-group-addon class does. </p> <figure id="15" src="Figure_15.tif"> <b>Figure 15: </b>Enhance your text-based controls by pre-pending and appending text and buttons. </figure> <p id="57">These new classes replace the Bootstrap 2.x .input-append, .input-prepend, and .add-on classes. </p> <codesnippet><div <font color="Red">class</font>="<font color="Blue">input-group</font>"></codesnippet> <codesnippet> <span <font color="Red">class</font>="<font color="Blue">input-group-addon</font>">$</span></codesnippet> <codesnippet> <input <font color="Red">type</font>="<font color="Blue">text</font>" <font color="Red">class</font>="<font color="Blue">form-control</font>"></codesnippet> <codesnippet> <span <font color="Red">class</font>="<font color="Blue">input-group-addon</font>">.00</span></codesnippet> <codesnippet></div></codesnippet> <p id="58">You can add the .input-group-lg and .input-group-sm classes to the .item-group to automatically resize all the controls without having to size each element. </p> <codesnippet><div <font color="Red">class</font>="<font color="Blue">input-group input-group-lg</font>"></codesnippet> <codesnippet> <span <font color="Red">class</font>="<font color="Blue">input-group-addon</font>">@</span></codesnippet> <codesnippet> <input <font color="Red">type</font>="<font color="Blue">text</font>" </codesnippet> <codesnippet>»»»»»<font color="Red">class</font>="<font color="Blue">form-control</font>" <font color="Red">placeholder</font>="<font color="Blue">Username</font>"></codesnippet> <codesnippet></div></codesnippet> <codesnippet>»</codesnippet> <codesnippet><div <font color="Red">class</font>="<font color="Blue">input-group input-group-sm</font>"></codesnippet> <codesnippet> <span <font color="Red">class</font>="<font color="Blue">input-group-addon</font>">$</span></codesnippet> <codesnippet> <input <font color="Red">type</font>="<font color="Blue">text</font>" <font color="Red">class</font>="<font color="Blue">form-control</font>"></codesnippet> <codesnippet> <span <font color="Red">class</font>="<font color="Blue">input-group-addon</font>">.00</span></codesnippet> <codesnippet></div></codesnippet> <h3>Checkbox and Radio Button</h3> <p id="59">In Bootstrap 2.x, checkboxes were wrapped in a <label> with a checkbox class. In Bootstrap 3, a <div> is now used to wrap the <label>, which still wraps the checkbox. </p> <codesnippet><!-- Bootstrap 2 --></codesnippet> <codesnippet> <font color="Blue"><</font>label <font color="Red">class</font><font color="Blue">="checkbox"></font></codesnippet> <codesnippet> <font color="Blue"><</font>input <font color="Red">type</font><font color="Blue">="checkbox"</font> <font color="Red">value</font><font color="Blue">=""></font>I agree.</codesnippet> <codesnippet> <font color="Blue"></</font>label<font color="Blue">></font></codesnippet> <codesnippet> </codesnippet> <codesnippet><!-- Bootstrap 3 --></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="checkbox"></font></codesnippet> <codesnippet> <font color="Blue"><</font>label<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>input <font color="Red">type</font><font color="Blue">="checkbox"</font> <font color="Red">value</font><font color="Blue">=""></font>I agree.</codesnippet> <codesnippet> <font color="Blue"></</font>label<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <p id="60">Radio buttons worked the same way in Bootstrap 2.x and received the same update in Bootstrap 3.</p> <codesnippet><!-- Bootstrap 2 --></codesnippet> <codesnippet> <font color="Blue"><</font>label <font color="Red">class</font><font color="Blue">="radio"></font></codesnippet> <codesnippet> <font color="Blue"><</font>input <font color="Red">type</font><font color="Blue">="radio"</font> <font color="Red">name</font><font color="Blue">="optionsRadios"</font> <font color="Red">id</font><font color="Blue">="Radio3"</font> </codesnippet> <codesnippet>»»»»<font color="Red">value</font><font color="Blue">="option1"></font>This is radio button #1</codesnippet> <codesnippet> <font color="Blue"></</font>label<font color="Blue">></font></codesnippet> <codesnippet>»</codesnippet> <codesnippet><!-- Bootstrap 3 --></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="radio"></font></codesnippet> <codesnippet> <font color="Blue"><</font>label<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>input <font color="Red">type</font><font color="Blue">="radio"</font> <font color="Red">name</font><font color="Blue">="optionsRadios"</font> <font color="Red">id</font><font color="Blue">="Radio4"</font></codesnippet> <codesnippet>»»»»»<font color="Red">value</font><font color="Blue">="option1"></font>This is radio button #1</codesnippet> <codesnippet> <font color="Blue"></</font>label<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <h3>Modals</h3> <p id="61">Modals have undergone some fairly minor changes. You no longer need to specify the .hide class in the modal declaration line like you did in Bootstrap 2.x because modal dialogs are hidden now by default. </p> <codesnippet><!-- Bootstrap 2 --></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="modal hide fade"></font></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="modal-header"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="modal-body"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="modal-footer"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <p id="62">Two additional classes have been added, .modal-content and .modal dialog. These new classes provide increased customization options for modals. The .modal-header, .modal-body, and .modal-footer are all wrapped inside of .modal-content. The .modal-content class is wrapped inside of .modal-dialog. </p> <codesnippet><!-- Bootstrap 3 --></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="modal fade"></font></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="modal-dialog"></font></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="modal-content"></font></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="modal-header"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="modal-body"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="modal-footer"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <h3>Typography</h3> <p id="63">The most noticeable change in the typography features is the use of a semi-bold Helvetica font for headings. Changes were also made in the emphasis classes. The .muted class was renamed to .text-muted.</p> <codesnippet><!-- Bootstrap 2 --></codesnippet> <codesnippet> <font color="Blue"><</font>p <font color="Red">class</font><font color="Blue">="muted"></font>This is muted text.<font color="Blue"></</font>p<font color="Blue">></font></codesnippet> <codesnippet>»</codesnippet> <codesnippet><!-- Bootstrap 3 --></codesnippet> <codesnippet> <font color="Blue"><</font>p <font color="Red">class</font><font color="Blue">="text-muted"></font>This is muted text.<font color="Blue"></</font>p<font color="Blue">></font></codesnippet> <p id="64">The .text-error class has been renamed to .text-danger.</p> <codesnippet><!-- Bootstrap 2 --></codesnippet> <codesnippet> <font color="Blue"><</font>p <font color="Red">class</font><font color="Blue">="text-error"></font>Danger, Will Robinson!<font color="Blue"></</font>p<font color="Blue">></font></codesnippet> <codesnippet>»</codesnippet> <codesnippet><!-- Bootstrap 3 --></codesnippet> <codesnippet> <font color="Blue"><</font>p <font color="Red">class</font><font color="Blue">="text-danger"></font>Danger, Will Robinson!<font color="Blue"></</font>p<font color="Blue">></font></codesnippet> <h3>Navbar</h3> <p id="65">Navbars provide navigation headers for your site. They have benefited from the focus on responsive design by starting out collapsed on mobile devices and expanding horizontally as the display screen widens. One primary difference is that navbars now use the HTML5 <nav> tag. The .navbar-inner class has been deprecated, so you need to remove any .navbar-inner <div> tags. The .brand class has been changed to .navbar-brand, so you need to change any .brand <div> tags. </p> <codesnippet><!-- Bootstrap 2 --></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="navbar"></font></codesnippet> <codesnippet> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="navbar-inner"></font></codesnippet> <codesnippet> <font color="Blue"><</font>a <font color="Red">class</font><font color="Blue">="brand"</font> <font color="Red">href</font><font color="Blue">="#"></font>Title<font color="Blue"></</font>a<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>ul <font color="Red">class</font><font color="Blue">="nav"></font></codesnippet> <codesnippet> <font color="Blue"><</font>li <font color="Red">class</font><font color="Blue">="active"><</font>a <font color="Red">href</font><font color="Blue">="#"></font>Home<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>li<font color="Blue">><</font>a <font color="Red">href</font><font color="Blue">="#"></font>Link<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>li<font color="Blue">><</font>a <font color="Red">href</font><font color="Blue">="#"></font>Link<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>ul<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>div<font color="Blue">></font></codesnippet> <p id="66">Navbars require a .navbar-header to wrap the new .navbar-brand and .navbar-toggle classes. You also need to add the .navbar-nav class where you use .nav. Refer to <b>Listing 6 </b>for a complete implementation of the .navbar class.</p> <h3>Images, Icons, and Buttons</h3> <p id="67">The Bootstrap 2 .img-polaroid class has been replaced with the .img-thumbnail in Bootstrap 3.</p> <codesnippet><!--Bootstrap 2--></codesnippet> <codesnippet> <font color="Blue"><</font>img <font color="Red">src</font><font color="Blue">="..."</font> <font color="Red">class</font><font color="Blue">="img-polaroid"></font></codesnippet> <codesnippet>»</codesnippet> <codesnippet><!--Bootstrap 3--></codesnippet> <codesnippet> <font color="Blue"><</font>img <font color="Red">src</font><font color="Blue">="..."</font> <font color="Red">alt</font><font color="Blue">="..."</font> <font color="Red">class</font><font color="Blue">="img-thumbnail"></font></codesnippet> <p id="68">Images are not responsive by default and the new .img-responsive class makes images responsive-friendly by setting the max-width to 100% and height to auto. This resizes the image to the size of the parent element.</p> <p id="69">In Bootstrap 3, images are placed using a <span> tag instead of using an <i> tag like they were in the prior version. All icons also require using the Glyphicon base class and then the specific class for the icon you’re using. </p> <codesnippet><!--Bootstrap 2--></codesnippet> <codesnippet> <font color="Blue"><</font>a <font color="Red">class</font><font color="Blue">="btn"</font> <font color="Red">href</font><font color="Blue">="#"><</font>i <font color="Red">class</font><font color="Blue">="icon-search"></</font>i<font color="Blue">></</font>a<font color="Blue">></font></codesnippet> <codesnippet>»</codesnippet> <codesnippet><!--Bootstrap 3--></codesnippet> <codesnippet> <font color="Blue"><</font>a <font color="Red">class</font><font color="Blue">="btn"</font> <font color="Red">href</font><font color="Blue">="#"></font></codesnippet> <codesnippet>»»»<font color="Blue"><</font>span <font color="Red">class</font><font color="Blue">="glyphicon glyphicon-search"></</font>span<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>a<font color="Blue">></font></codesnippet> <p id="70">The button class structure changes are not all that complex, but they’re changes you definitely need to be aware of. The .btn-mini, .btn-small, and .btn-large classes have been replaced by .btn-xs, .btn-sm, and .btn-lg respectively. Default buttons now have their own class, .btn-default, and the .btn-inverse class has been removed. The code in <b>Listing 7 </b>shows the Bootstrap 2.x button classes and their Bootstrap 3.0 equivalents. <b>Figure 16 </b>illustrates the visual changes that occurred in the update from v2.x to v3.0. </p> <figure id="16" src="Figure_16.tif"> <b>Figure 16: </b>Buttons have undergone a few visual changes from the prior version. </figure> <h3>Carousel</h3> <p id="71">Only minor changes are needed to existing carousel controls. The changes consist of using the new Glyphicon chevron images as the next and previous buttons. </p> <codesnippet> <font color="Blue"><</font>a <font color="Red">class</font><font color="Blue">="left carousel-control"</font> </codesnippet> <codesnippet>»»»<font color="Red">href</font><font color="Blue">="#carousel-example-generic"</font> <font color="Red">data-slide</font><font color="Blue">="prev"></font></codesnippet> <codesnippet>»»»»»<font color="Blue"><</font>span <font color="Red">class</font><font color="Blue">="glyphicon glyphicon-chevron-left"></font></codesnippet> <codesnippet>»»»»»<font color="Blue"></</font>span<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>a<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"><</font>a <font color="Red">class</font><font color="Blue">="right carousel-control"</font> </codesnippet> <codesnippet>»»»»<font color="Red">href</font><font color="Blue">="#carousel-example-generic"</font> <font color="Red">data-slide</font><font color="Blue">="next"></font></codesnippet> <codesnippet> <font color="Blue"><</font>span <font color="Red">class</font><font color="Blue">="glyphicon glyphicon-chevron-right"></font></codesnippet> <codesnippet>»»»»<font color="Blue"></</font>span<font color="Blue">></font></codesnippet> <codesnippet> <font color="Blue"></</font>a<font color="Blue">></font></codesnippet> <h3>Responsive Utilities</h3> <p id="72">If you’re using the responsive utilities on your Bootstrap 2.x site, you’re going to need to update those class references as well. <b>Table 3 </b>lists the responsive utility class changes in Bootstrap 3.</p> <h3>Some Things Had To Go</h3> <p id="73">“Out with the old and in with the new,” is how the saying goes. That also applies to Bootstrap 3. There are a number of elements from the prior version that have been depreciated. <b>Table 4 </b>lists the Bootstrap 2.x items that were removed along with the corresponding Bootstrap 3 replacement.</p> <h3>Summary</h3> <p id="74">I have come to the end of the article and I didn’t have the space to cover every new Bootstrap 3 feature, but I did cover quite a few. By now, I’m sure you’re realizing that you’ve got some work to do updating your Bootstrap 2.x sites to Bootstrap 3. Fortunately there are a number of resources and tools available to help you do just that.</p> <p id="75">The first place to start will be the Bootstrap site itself. The documentation has been updated to include information about migrating from 2.x to 3.0 (http://getbootstrap.com/getting-started/#migration). Here is a list of online tools that will help you migrate your Bootstrap 2.x code over to Bootstrap 3.</p> </body> <sidebars> <sidebar page="" title="Bootstrap Website"> <p id="76">You’ll find links to download Bootstrap 3 and links to documentation and samples on the http://getbootstrap.com website. </p> </sidebar> <sidebar page="" title="Migration Resources"> <p id="77">Here’s a list of resources to help you migrate from Bootstrap 2.x to Bootstrap 3.</p> <p id="78"> <b>Bootply Migration Tool</b> </p> <p id="79">http://upgrade-bootstrap.bootply.com/</p> <p id="80"> <b>Bootstrap Updater</b> </p> <p id="81">http://code.divshot.com/bootstrap3_upgrader/</p> <p id="82"> <b>Bootstrap Migrator</b> </p> <p id="83">http://twitterbootstrapmigrator.w3masters.nl/</p> <p id="84"> <b>Bootstrap 3 Updater</b> </p> <p id="85">http://bootstrap3.kissr.com/</p> </sidebar> <sidebar page="" title="Bootstrap Themes"> <p id="86">There are a number of Bootstrap theme resources available. Some provide free themes and others sell them, usually at a very nominal cost. Make sure that any theme you download is compatible with Bootstrap 3 before you download it.</p> <p id="87">http://wrapbootstrap.com/</p> <p id="88">http://bootswatch.com/</p> <p id="89">http://bootstrapthemes.com/</p> </sidebar> <sidebar page="" title="Bootstrap’s Origins"> <p id="90">Developed by Mark Otto and Jacob Thorton from Twitter, Bootstrap’s inspiration came from the desire to promote uniformity across internal tools. Prior to Bootstrap’s creation, software engineers at Twitter used various libraries to develop interface-based tools against and, as a result, these tools became hard to sustain due to inconsistencies between the different libraries used. These inconsistencies led to the creation of a toolkit for commonly used interface components. </p> <p id="91">Initially deployed and shown during Twitter’s first Hackweek, Bootstrap assisted software engineers by providing a toolkit encompassing all the interface components frequently used by the company. Bootstrap’s creation encouraged consistency and quicker development of internal tools due to the standardization of interface components instead of reinventing the wheel during each tool’s development. After a successful deployment within the company, Twitter released Bootstrap to the public through an open-source project in August 2011. In the course of multiple releases since the initial open-source launch, Bootstrap grew into the most popular GitHub development project available for download and, launched in August 2013, Bootstrap 3.0 became the latest stable release of the toolkit.</p> </sidebar> </sidebars> <figures> </figures> <tables> <table page="" id="1"> <tablecaption>Table 1: Grid options with container, columns, and CSS class settings.</tablecaption> <tr> <th> <p id="92"> <b> </b> </p> <p id="93"> <b> </b> </p> </th> <th> <p id="94"> <b>Extra Small Devices</b> </p> <p id="95"> <b>Phones (< 768px)</b> </p> </th> <th> <p id="96"> <b>Small Devices</b> </p> <p id="97"> <b>Tablets (>=768px)</b> </p> </th> <th> <p id="98"> <b>Medium Devices</b> </p> <p id="99"> <b>Desktops (>=922px)</b> </p> </th> <th> <p id="100"> <b>Large Devices</b> </p> <p id="101"> <b>Desktops (>=1200px)</b> </p> </th> </tr> <tr> <td> <p id="102">Max Container Width</p> </td> <td> <p id="103">None (auto)</p> </td> <td> <p id="104">750px</p> </td> <td> <p id="105">970px</p> </td> <td> <p id="106">1170px</p> </td> </tr> <tr> <td> <p id="107">Number of Columns</p> </td> <td> <p id="108">12</p> </td> <td> <p id="109">12</p> </td> <td> <p id="110">12</p> </td> <td> <p id="111">12</p> </td> </tr> <tr> <td> <p id="112">Max Column Width</p> </td> <td> <p id="113">Auto</p> </td> <td> <p id="114">60px</p> </td> <td> <p id="115">78px</p> </td> <td> <p id="116">95px</p> </td> </tr> <tr> <td> <p id="117">Class Prefix</p> </td> <td> <p id="118">col-xs-</p> </td> <td> <p id="119">col-sm-</p> </td> <td> <p id="120">col-md-</p> </td> <td> <p id="121">col-lg-</p> </td> </tr> </table> <table page="" id="2"> <tablecaption>Table 2: New Bootstrap 3.0 Classes & Elements</tablecaption> <tr> <th> <p id="122"> <b>Element</b> </p> </th> <th> <p id="123"> <b>Description</b> </p> </th> </tr> <tr> <td> <p id="124">Panels</p> </td> <td> <p id="125">.panel .panel-body .panel-title .panel-heading .panel-footer .panel-collapse</p> </td> </tr> <tr> <td> <p id="126">List groups</p> </td> <td> <p id="127">.list-group .list-group-item .list-group-item-text .list-group-item-heading</p> </td> </tr> <tr> <td> <p id="128">Jumbotron</p> </td> <td> <p id="129">.jumbotron</p> </td> </tr> <tr> <td> <p id="130">Glyphicons</p> </td> <td> <p id="131">.glyphicon</p> </td> </tr> <tr> <td> <p id="132">Large grid (>1200 px wide)</p> </td> <td> <p id="133">.col-lg-*</p> </td> </tr> <tr> <td> <p id="134">Medium grid (>992 px wide)</p> </td> <td> <p id="135">.col-md-*</p> </td> </tr> <tr> <td> <p id="136">Small grid (>768 px wide)</p> </td> <td> <p id="137">.col-sm-*</p> </td> </tr> <tr> <td> <p id="138">Tiny grid (<768 px wide)</p> </td> <td> <p id="139">.col-xs-*</p> </td> </tr> <tr> <td> <p id="140">Column Offsets</p> </td> <td> <p id="141">.col-sm-offset-* .col-md-offset-* .col-lg-offset-*</p> </td> </tr> <tr> <td> <p id="142">Column Push</p> </td> <td> <p id="143">.col-sm-push-* .col-md-push-* .col-lg-push-*</p> </td> </tr> <tr> <td> <p id="144">Colum Pull</p> </td> <td> <p id="145">.col-sm-pull-* .col-md-pull-* .col-lg-pull-*</p> </td> </tr> <tr> <td> <p id="146">Thumbnail image</p> </td> <td> <p id="147">.img-thumbnail</p> </td> </tr> <tr> <td> <p id="148">Responsive images</p> </td> <td> <p id="149">.img-responsive</p> </td> </tr> <tr> <td> <p id="150">Modal</p> </td> <td> <p id="151">.modal-dialog .modal-content</p> </td> </tr> <tr> <td> <p id="152">Alert links</p> </td> <td> <p id="153">.alert-link</p> </td> </tr> <tr> <td> <p id="154">Well sizes</p> </td> <td> <p id="155">.well-sm .well-lg</p> </td> </tr> <tr> <td> <p id="156">Navbar</p> </td> <td> <p id="157">.navbar-default .navbar-text .navbar-btn</p> </td> </tr> <tr> <td> <p id="158">Navbar header</p> </td> <td> <p id="159">.navbar-header</p> </td> </tr> <tr> <td> <p id="160">Justified tabs / pills</p> </td> <td> <p id="161">.nav-justified</p> </td> </tr> <tr> <td> <p id="162">Form controls</p> </td> <td> <p id="163">.form-control .form-group</p> </td> </tr> <tr> <td> <p id="164">Button group sizes</p> </td> <td> <p id="165">.btn-group-xs .btn-group-sm .btn-group-lg</p> </td> </tr> <tr> <td> <p id="166">Input groups</p> </td> <td> <p id="167">.input-group .input-group-addon .input-group-btn</p> </td> </tr> <tr> <td> <p id="168">Inline controls</p> </td> <td> <p id="169">.checkbox-inline .radio-inline</p> </td> </tr> <tr> <td> <p id="170">Contextual panels</p> </td> <td> <p id="171">.panel-success .panel-danger .panel-warning .panel-info</p> </td> </tr> <tr> <td> <p id="172">Contextual table rows</p> </td> <td> <p id="173">.success .danger .warning .active</p> </td> </tr> </table> <table page="" id="3"> <tablecaption>Table 3: Responsive utility changes in Bootstrap 3</tablecaption> <tr> <th> <p id="174"> <b>Bootstrap 2.x</b> </p> </th> <th> <p id="175"> <b>Bootstrap 3</b> </p> </th> </tr> <tr> <td> <p id="176">.visible-phone</p> </td> <td> <p id="177">.visible-sm</p> </td> </tr> <tr> <td> <p id="178">.visible-tablet</p> </td> <td> <p id="179">.visible-md</p> </td> </tr> <tr> <td> <p id="180">.visible-desktop</p> </td> <td> <p id="181">.visible-lg</p> </td> </tr> <tr> <td> <p id="182">.hidden-phone</p> </td> <td> <p id="183">.hidden-sm</p> </td> </tr> <tr> <td> <p id="184">.hidden-tablet</p> </td> <td> <p id="185">.hidden-md</p> </td> </tr> <tr> <td> <p id="186">.hidden-desktop</p> </td> <td> <p id="187">.hidden-lg</p> </td> </tr> </table> <table page="" id="4"> <tablecaption>Table 4: Classes and Components Removed in Bootstrap 3</tablecaption> <tr> <th> <p id="188"> <b>Element</b> </p> </th> <th> <p id="189"> <b>Removed From Bootstrap 2.x</b> </p> </th> <th> <p id="190"> <b>Bootstrap 3.0 Equivalent</b> </p> </th> </tr> <tr> <td> <p id="191">Grid</p> </td> <td> <p id="192">.span*</p> </td> <td> <p id="193">.col-md-*</p> </td> </tr> <tr> <td> <p id="194">Fluid container</p> </td> <td> <p id="195">.container-fluid</p> </td> <td> <p id="196">.container</p> </td> </tr> <tr> <td> <p id="197">Fluid row</p> </td> <td> <p id="198">.row-fluid</p> </td> <td> <p id="199">.row</p> </td> </tr> <tr> <td> <p id="200">Icons</p> </td> <td> <p id="201">.icon-*</p> </td> <td> <p id="202">.glyphicon-*</p> </td> </tr> <tr> <td> <p id="203">Hero Unit</p> </td> <td> <p id="204">.hero-unit</p> </td> <td> <p id="205">.jumbotron</p> </td> </tr> <tr> <td> <p id="206">Nav list</p> </td> <td> <p id="207">.nav-list</p> </td> <td> <p id="208">.list-group</p> </td> </tr> <tr> <td> <p id="209">Navbar inner</p> </td> <td> <p id="210">.navbar-inner</p> </td> <td> <p id="211">-</p> </td> </tr> <tr> <td> <p id="212">Navbar button</p> </td> <td> <p id="213">.btn-navbar</p> </td> <td> <p id="214">.navbar-btn</p> </td> </tr> <tr> <td> <p id="215">Thumbnails</p> </td> <td> <p id="216">.thumbnails</p> </td> <td> <p id="217">.col-* and .thumbnail</p> </td> </tr> <tr> <td> <p id="218">Form actions</p> </td> <td> <p id="219">.form-actions</p> </td> <td> <p id="220">-</p> </td> </tr> <tr> <td> <p id="221">Input append / prepend</p> </td> <td> <p id="222">.input-append .input-prepend .add-on</p> </td> <td> <p id="223">.input-group</p> </td> </tr> <tr> <td> <p id="224">Tab alignments</p> </td> <td> <p id="225">.tabs-left .tabs-right .tabs-below</p> </td> <td> <p id="226">-</p> </td> </tr> <tr> <td> <p id="227">Dropdown submenu</p> </td> <td> <p id="228">.dropdown-submenu</p> </td> <td> <p id="229">-</p> </td> </tr> </table> </tables> <codelistings> <codelisting page="" id="0" header="Listing 1: Horizontal form usage and functionality"> <code> <font color="Blue"><</font>form»<font color="Red">class</font><font color="Blue">="form-horizontal"»</font><font color="Red">role</font><font color="Blue">="form"></font></code> <code>»»<font color="Blue"><</font>div»<font color="Red">class</font><font color="Blue">="form-group"></font></code> <code>»»»»<font color="Blue"><</font>label»<font color="Red">for</font><font color="Blue">="inputEmail1"»</font><font color="Red">class</font><font color="Blue">="col-lg-2»control-label"></font></code> <code>»»»»»»Email</code> <code>»»»»<font color="Blue"></</font>label<font color="Blue">></font></code> <code>»»»»<font color="Blue"><</font>div»<font color="Red">class</font><font color="Blue">="col-lg-10"></font></code> <code>»»»»»»<font color="Blue"><</font>input»<font color="Red">type</font><font color="Blue">="email"»</font><font color="Red">class</font><font color="Blue">="form-control"</font></code> <code>»»»»»»»»<font color="Red">id</font><font color="Blue">="inputEmail1"»</font><font color="Red">placeholder</font><font color="Blue">="Email"></font></code> <code>»»»»<font color="Blue"></</font>div<font color="Blue">></font></code> <code>»»<font color="Blue"></</font>div<font color="Blue">></font></code> <code>»»<font color="Blue"><</font>div»<font color="Red">class</font><font color="Blue">="form-group"></font></code> <code>»»»»<font color="Blue"><</font>label»<font color="Red">for</font><font color="Blue">="inputPassword1"»</font><font color="Red">class</font><font color="Blue">="col-lg-2»control-label"></font></code> <code>»»»»»»Password</code> <code>»»»»<font color="Blue"></</font>label<font color="Blue">></font></code> <code>»»»»<font color="Blue"><</font>div»<font color="Red">class</font><font color="Blue">="col-lg-10"></font></code> <code>»»»»»»<font color="Blue"><</font>input»<font color="Red">type</font><font color="Blue">="password"»</font><font color="Red">class</font><font color="Blue">="form-control"</font></code> <code>»»»»»»»»<font color="Red">id</font><font color="Blue">="inputPassword1"»</font><font color="Red">placeholder</font><font color="Blue">="Password"></font></code> <code>»»»»<font color="Blue"></</font>div<font color="Blue">></font></code> <code>»»<font color="Blue"></</font>div<font color="Blue">></font></code> <code>»»<font color="Blue"><</font>div»<font color="Red">class</font><font color="Blue">="form-group"></font></code> <code>»»»»<font color="Blue"><</font>div»<font color="Red">class</font><font color="Blue">="col-lg-offset-2»col-lg-10"></font></code> <code>»»»»»»<font color="Blue"><</font>div»<font color="Red">class</font><font color="Blue">="checkbox"></font></code> <code>»»»»»»»»<font color="Blue"><</font>label<font color="Blue">></font></code> <code>»»»»»»»»»»<font color="Blue"><</font>input»<font color="Red">type</font><font color="Blue">="checkbox">»</font>Remember»me</code> <code>»»»»»»»»<font color="Blue"></</font>label<font color="Blue">></font></code> <code>»»»»»»<font color="Blue"></</font>div<font color="Blue">></font></code> <code>»»»»<font color="Blue"></</font>div<font color="Blue">></font></code> <code>»»<font color="Blue"></</font>div<font color="Blue">></font></code> <code>»»<font color="Blue"><</font>div»<font color="Red">class</font><font color="Blue">="form-group"></font></code> <code>»»»»<font color="Blue"><</font>div»<font color="Red">class</font><font color="Blue">="col-lg-offset-2»col-lg-10"></font></code> <code>»»»»»»<font color="Blue"><</font>button»<font color="Red">type</font><font color="Blue">="submit"»</font><font color="Red">class</font><font color="Blue">="btn»btn-default"></font></code> <code>»»»»»»»»Sign»in</code> <code>»»»»»»<font color="Blue"></</font>button<font color="Blue">></font></code> <code>»»»»<font color="Blue"></</font>div<font color="Blue">></font></code> <code>»»<font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"></</font>form<font color="Blue">></font></code> </codelisting> <codelisting page="" id="36" header="Listing 2: Code example of Bootstrap’s Button functionality"> <code><button»<font color="Red">type</font>="<font color="Blue">button</font>"»<font color="Red">class</font>="<font color="Blue">btn»btn-default</font>"></code> <code>»»Default</code> <code></button></code> <code><button»<font color="Red">type</font>="<font color="Blue">button</font>"»<font color="Red">class</font>="<font color="Blue">btn»btn-primary</font>"></code> <code>»»Primary</code> <code></button></code> <code><button»<font color="Red">type</font>="<font color="Blue">button</font>"»<font color="Red">class</font>="<font color="Blue">btn»btn-success</font>"></code> <code>»»Success</code> <code></button></code> <code><button»<font color="Red">type</font>="<font color="Blue">button</font>"»<font color="Red">class</font>="<font color="Blue">btn»btn-info</font>"></code> <code>»»Info</code> <code></button></code> <code><button»<font color="Red">type</font>="button"»<font color="Red">class</font>="<font color="Blue">btn»btn-warning</font>"></code> <code>»»Warning</code> <code></button></code> <code><button»<font color="Red">type</font>="<font color="Blue">button</font>"»<font color="Red">class</font>="<font color="Blue">btn»btn-danger</font>"></code> <code>»»Danger</code> <code></button></code> <code><button»<font color="Red">type</font>="<font color="Blue">button</font>"»<font color="Red">class</font>="<font color="Blue">btn»btn-link</font>"></code> <code>»»Link</code> <code></button></code> <code><br»/></code> <code><button»<font color="Red">type</font>="<font color="Blue">button</font>"»<font color="Red">class</font>="<font color="Blue">btn»btn-default»btn-lg</font>"></code> <code>»»Large»button</code> <code></button></code> <code><button»<font color="Red">type</font>="<font color="Blue">button</font>"»<font color="Red">class</font>="<font color="Blue">btn»btn-default»btn-sm</font>"></code> <code>»»Small»button</code> <code></button></code> <code><button»<font color="Red">type</font>="<font color="Blue">button</font>"»<font color="Red">class</font>="<font color="Blue">btn»btn-default»btn-xs</font>"></code> <code>»»Extra»small»button</code> <code></button></code> <code><button»<font color="Red">type</font>="<font color="Blue">button</font>"»<font color="Red">class</font>="<font color="Blue">btn»btn-default</font>"»<font color="Red">disabled</font>="<font color="Blue">disabled</font>"></code> <code>»»Button</code> <code></button></code> </codelisting> <codelisting page="" id="70" header="Listing 3: Code example of Bootstrap’s Modal functionality"> <code> <font color="Blue"><</font>button»<font color="Red">type</font><font color="Blue">="button"»</font><font color="Red">data-toggle</font><font color="Blue">="modal"»</font><font color="Red">data-target</font><font color="Blue">="#myModal"</font></code> <code>»»<font color="Red">class</font><font color="Blue">="btn»btn-primary»btn-lg"></font>Launch»modal<font color="Blue"></</font>button<font color="Blue">></font></code> <code> </code> <code> <font color="Blue"><</font>div»<font color="Red">class</font><font color="Blue">="modal»fade"»</font><font color="Red">id</font><font color="Blue">="myModal"»</font><font color="Red">tabindex</font><font color="Blue">="-1"»</font><font color="Red">role</font><font color="Blue">="dialog"</font></code> <code>»»<font color="Red">aria-labelledby</font><font color="Blue">="myModalLabel"»</font><font color="Red">aria-hidden</font><font color="Blue">="true"></font></code> <code>»»<font color="Blue"><</font>div»<font color="Red">class</font><font color="Blue">="modal-dialog"></font></code> <code>»»»»<font color="Blue"><</font>div»<font color="Red">class</font><font color="Blue">="modal-content"></font></code> <code>»»»»»»<font color="Blue"><</font>div»<font color="Red">class</font><font color="Blue">="modal-header"></font></code> <code>»»»»»»»»<font color="Blue"><</font>button»<font color="Red">type</font><font color="Blue">="button"»</font><font color="Red">class</font><font color="Blue">="close"»</font><font color="Red">data-dismiss</font><font color="Blue">="modal"</font></code> <code>»»»»»»»»»»<font color="Red">aria-hidden</font><font color="Blue">="true"></font></code> <code>»»»»»»»»»»<font color="Red">&times;</font></code> <code>»»»»»»»»<font color="Blue"></</font>button<font color="Blue">></font></code> <code>»»»»»»»»<font color="Blue"><</font>h4»<font color="Red">class</font><font color="Blue">="modal-title"></font>Modal»title<font color="Blue"></</font>h4<font color="Blue">></font></code> <code>»»»»»»<font color="Blue"></</font>div<font color="Blue">></font></code> <code>»»»»»»<font color="Blue"><</font>div»<font color="Red">class</font><font color="Blue">="modal-body"></font></code> <code>»»»»»»»»Modal»body»text»is»displayed»here</code> <code>»»»»»»<font color="Blue"></</font>div<font color="Blue">></font></code> <code>»»»»»»<font color="Blue"><</font>div»<font color="Red">class</font><font color="Blue">="modal-footer"></font></code> <code>»»»»»»»»<font color="Blue"><</font>button»<font color="Red">type</font><font color="Blue">="button"»</font><font color="Red">class</font><font color="Blue">="btn»btn-default"</font></code> <code>»»»»»»»»»»<font color="Red">data-dismiss</font><font color="Blue">="modal"></font></code> <code>»»»»»»»»»»Close</code> <code>»»»»»»»»<font color="Blue"></</font>button<font color="Blue">></font></code> <code>»»»»»»»»<font color="Blue"><</font>button»<font color="Red">type</font><font color="Blue">="button"»</font><font color="Red">class</font><font color="Blue">="btn»btn-primary"></font></code> <code>»»»»»»»»»»Save»changes</code> <code>»»»»»»»»<font color="Blue"></</font>button<font color="Blue">></font></code> <code>»»»»»»<font color="Blue"></</font>div<font color="Blue">></font></code> <code>»»»»<font color="Blue"></</font>div<font color="Blue">></font></code> <code>»»<font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> </codelisting> <codelisting page="" id="99" header="Listing 4: Code example of Bootstrap’s Panel Component functionality"> <code> <font color="Blue"><!</font>DOCTYPE <font color="Red">html</font><font color="Blue">></font></code> <code>»</code> <code> <font color="Blue"><</font>html <font color="Red">lang</font><font color="Blue">="en"></font></code> <code> <font color="Blue"><</font>head<font color="Blue">></font></code> <code> <font color="Blue"><</font>meta <font color="Red">charset</font><font color="Blue">="utf-8"</font> <font color="Blue">/></font></code> <code> <font color="Blue"><</font>meta <font color="Red">name</font><font color="Blue">="viewport"</font> <font color="Red">content</font><font color="Blue">="width=device-width, </font></code> <code> <font color="Blue">initial-scale=1.0"></font> </code> <code> <font color="Blue"><</font>title<font color="Blue">></</font>title<font color="Blue">></font></code> <code> <!-- Bootstrap core CSS --></code> <code> <font color="Blue"><</font>link <font color="Red">href</font><font color="Blue">="css/bootstrap.css"</font> <font color="Red">rel</font><font color="Blue">="stylesheet"></font></code> <code> <font color="Blue"></</font>head<font color="Blue">></font></code> <code> <font color="Blue"><</font>body<font color="Blue">></font></code> <code>» <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="container"></font></code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel panel-default"></font></code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel-body"></font></code> <code> Basic panel example</code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code>»</code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel panel-default"></font></code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel-heading"></font></code> <code> <font color="Blue"><</font>h3 <font color="Red">class</font><font color="Blue">="panel-title"></font>Panel Default title<font color="Blue"></</font>h3<font color="Blue">></font></code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel-body"></font></code> <code> Panel content</code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel-footer"></font></code> <code> Panel Footer</code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code>»</code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel panel-primary"></font></code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel-heading"></font></code> <code> <font color="Blue"><</font>h3 <font color="Red">class</font><font color="Blue">="panel-title"></font>Panel Primary title<font color="Blue"></</font>h3<font color="Blue">></font></code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel-body"></font></code> <code> Panel content</code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel-footer"></font></code> <code> Panel Footer</code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code>»</code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel panel-success"></font></code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel-heading"></font></code> <code> <font color="Blue"><</font>h3 <font color="Red">class</font><font color="Blue">="panel-title"></font>Panel Success title<font color="Blue"></</font>h3<font color="Blue">></font></code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel-body"></font></code> <code> Panel content</code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code>»</code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel panel-warning"></font></code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel-heading"></font></code> <code> <font color="Blue"><</font>h3 <font color="Red">class</font><font color="Blue">="panel-title"></font>Panel Warning title<font color="Blue"></</font>h3<font color="Blue">></font></code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel-body"></font></code> <code> Panel content</code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code>»</code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel panel-danger"></font></code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel-heading"></font></code> <code> <font color="Blue"><</font>h3 <font color="Red">class</font><font color="Blue">="panel-title"></font>Panel Danger title<font color="Blue"></</font>h3<font color="Blue">></font></code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel-body"></font></code> <code> Panel content</code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code>»</code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel panel-info"></font></code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel-heading"></font></code> <code> <font color="Blue"><</font>h3 <font color="Red">class</font><font color="Blue">="panel-title"></font>Panel Info title<font color="Blue"></</font>h3<font color="Blue">></font></code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="panel-body"></font></code> <code> Panel content</code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"></</font>body<font color="Blue">></font></code> <code> <font color="Blue"></</font>html<font color="Blue">></font></code> </codelisting> <codelisting page="" id="180" header="Listing 5: Code example of Bootstrap’s ListGroup Component and its complex HTML functionality"> <code> <font color="Blue"><!</font>DOCTYPE <font color="Red">html</font><font color="Blue">></font></code> <code>»</code> <code> <font color="Blue"><</font>html <font color="Red">lang</font><font color="Blue">="en"></font></code> <code> <font color="Blue"><</font>head<font color="Blue">></font></code> <code> <font color="Blue"><</font>meta <font color="Red">charset</font><font color="Blue">="utf-8"</font> <font color="Blue">/></font></code> <code> <font color="Blue"><</font>meta <font color="Red">name</font><font color="Blue">="viewport"</font> <font color="Red">content</font><font color="Blue">="width=device-width, </font></code> <code>»»»»»»»»<font color="Blue">initial-scale=1.0"></font></code> <code> <font color="Blue"><</font>title<font color="Blue">></</font>title<font color="Blue">></font></code> <code> <!-- Bootstrap core CSS --></code> <code> <font color="Blue"><</font>link <font color="Red">href</font><font color="Blue">="css/bootstrap.css"</font> <font color="Red">rel</font><font color="Blue">="stylesheet"></font></code> <code> <font color="Blue"></</font>head<font color="Blue">></font></code> <code> <font color="Blue"><</font>body<font color="Blue">></font></code> <code>»</code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="container"></font></code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="list-group"></font></code> <code> <font color="Blue"><</font>a <font color="Red">href</font><font color="Blue">="#"</font> <font color="Red">class</font><font color="Blue">="list-group-item active"></font></code> <code> <font color="Blue"><</font>h2 <font color="Red">class</font><font color="Blue">="list-group-item-heading"></font>Microsoft<font color="Blue"></</font>h2<font color="Blue">></font></code> <code> <font color="Blue"><</font>p <font color="Red">class</font><font color="Blue">="list-group-item-text"></font></code> <code>»»»»»»»»»This is text that is being used to demonstrate list </code> <code>»»»»»»»»»groups. Lorem ipsum dolor sit amet, consectetur </code> <code>»»»»»»»»»adipisicing elit, sed do eiusmod tempor incididunt </code> <code>»»»»»»»»»ut labore et dolore magna aliqua.<font color="Blue"></</font>p<font color="Blue">></font></code> <code>» <font color="Blue"><</font>h4 <font color="Red">class</font><font color="Blue">="list-group-item-footer"></font>This is the footer<font color="Blue"></</font>h4></code> <code>»» <font color="Blue"></</font>a<font color="Blue">></font></code> <code> <font color="Blue"><</font>a <font color="Red">href</font><font color="Blue">="#"</font> <font color="Red">class</font><font color="Blue">="list-group-item active"></font></code> <code> <font color="Blue"><</font>h2 <font color="Red">class</font><font color="Blue">="list-group-item-heading"></font>Google<font color="Blue"></</font>h2<font color="Blue">></font></code> <code> <font color="Blue"><</font>p <font color="Red">class</font><font color="Blue">="list-group-item-text"></font></code> <code>»»»»»»»»»This is text that is being used to demonstrate list </code> <code>»»»»»»»»»groups. Lorem ipsum dolor sit amet, consectetur </code> <code>»»»»»»»»»adipisicing elit, sed do eiusmod tempor incididunt </code> <code>»»»»»»»»»ut labore et dolore magna aliqua.<font color="Blue"></</font>p<font color="Blue">></font></code> <code>»» <font color="Blue"></</font>a<font color="Blue">></font> </code> <code> <font color="Blue"><</font>a <font color="Red">href</font><font color="Blue">="#"</font> <font color="Red">class</font><font color="Blue">="list-group-item active"></font></code> <code> <font color="Blue"><</font>h2 <font color="Red">class</font><font color="Blue">="list-group-item-heading"></font>Apple<font color="Blue"></</font>h2<font color="Blue">></font></code> <code> <font color="Blue"><</font>p <font color="Red">class</font><font color="Blue">="list-group-item-text"></font></code> <code>»»»»»»»»»This is text that is being used to demonstrate list </code> <code>»»»»»»»»»groups. Lorem ipsum dolor sit amet, consectetur </code> <code>»»»»»»»»»adipisicing elit, sed do eiusmod tempor incididunt </code> <code>»»»»»»»»»ut labore et dolore magna aliqua.<font color="Blue"></</font>p<font color="Blue">></font></code> <code>»» <font color="Blue"></</font>a<font color="Blue">></font> </code> <code> <font color="Blue"><</font>a <font color="Red">href</font><font color="Blue">="#"</font> <font color="Red">class</font><font color="Blue">="list-group-item active"></font></code> <code> <font color="Blue"><</font>h2 <font color="Red">class</font><font color="Blue">="list-group-item-heading"></font>Amazon<font color="Blue"></</font>h2<font color="Blue">></font></code> <code> <font color="Blue"><</font>p <font color="Red">class</font><font color="Blue">="list-group-item-text"></font></code> <code>»»»»»»»»»This is text that is being used to demonstrate list </code> <code>»»»»»»»»»groups. Lorem ipsum dolor sit amet, consectetur </code> <code>»»»»»»»»»adipisicing elit, sed do eiusmod tempor incididunt </code> <code>»»»»»»»»»ut labore et dolore magna aliqua.<font color="Blue"></</font>p<font color="Blue">></font></code> <code>»» <font color="Blue"></</font>a> </code> <code>»»»<font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"></</font>body<font color="Blue">></font></code> <code> <font color="Blue"></</font>html<font color="Blue">></font></code> </codelisting> <codelisting page="" id="232" header="Listing 6: Code Example Using the New Navbar classes"> <code> <font color="Blue"><</font>nav <font color="Red">class</font><font color="Blue">="navbar navbar-default"</font> <font color="Red">role</font><font color="Blue">="navigation"></font></code> <code> <!-- Brand and toggle get grouped for better mobile display --></code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="navbar-header"></font></code> <code> <font color="Blue"><</font>button <font color="Red">type</font><font color="Blue">="button"</font> <font color="Red">class</font><font color="Blue">="navbar-toggle"</font> </code> <code>»»»»»»<font color="Red">data-toggle</font><font color="Blue">="collapse"</font> </code> <code>»»»»»»<font color="Red">data-target</font><font color="Blue">=".navbar-ex1-collapse"></font></code> <code> <font color="Blue"><</font>span <font color="Red">class</font><font color="Blue">="sr-only"></font>Toggle navigation<font color="Blue"></</font>span<font color="Blue">></font></code> <code> <font color="Blue"><</font>span <font color="Red">class</font><font color="Blue">="icon-bar"></</font>span<font color="Blue">></font></code> <code> <font color="Blue"><</font>span <font color="Red">class</font><font color="Blue">="icon-bar"></</font>span<font color="Blue">></font></code> <code> <font color="Blue"><</font>span <font color="Red">class</font><font color="Blue">="icon-bar"></</font>span<font color="Blue">></font></code> <code> <font color="Blue"></</font>button<font color="Blue">></font></code> <code> <font color="Blue"><</font>a <font color="Red">class</font><font color="Blue">="navbar-brand"</font> <font color="Red">href</font><font color="Blue">="#"></font>Brand<font color="Blue"></</font>a<font color="Blue">></font></code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code>»</code> <code><!-- nav links, forms, and other content for toggling --></code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="collapse navbar-collapse navbar-ex1-collapse"></font></code> <code> <font color="Blue"><</font>ul <font color="Red">class</font><font color="Blue">="nav navbar-nav"></font></code> <code> <font color="Blue"><</font>li <font color="Red">class</font><font color="Blue">="active"><</font>a <font color="Red">href</font><font color="Blue">="#"></font>Link<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></code> <code> <font color="Blue"><</font>li<font color="Blue">><</font>a <font color="Red">href</font><font color="Blue">="#"></font>Link<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></code> <code> <font color="Blue"><</font>li <font color="Red">class</font><font color="Blue">="dropdown"></font></code> <code> <font color="Blue"><</font>a <font color="Red">href</font><font color="Blue">="#"</font> <font color="Red">class</font><font color="Blue">="dropdown-toggle"</font> </code> <code>»»»»»»»»»»»<font color="Red">data-toggle</font><font color="Blue">="dropdown"></font>Dropdown <font color="Blue"><</font>b <font color="Red">class</font><font color="Blue">="caret"></</font>b<font color="Blue">></</font>a<font color="Blue">></font></code> <code> <font color="Blue"><</font>ul <font color="Red">class</font><font color="Blue">="dropdown-menu"></font></code> <code> <font color="Blue"><</font>li<font color="Blue">><</font>a <font color="Red">href</font><font color="Blue">="#"></font>Action<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></code> <code> <font color="Blue"><</font>li<font color="Blue">><</font>a <font color="Red">href</font><font color="Blue">="#"></font>Another action<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></code> <code> <font color="Blue"><</font>li<font color="Blue">><</font>a <font color="Red">href</font><font color="Blue">="#"></font>Something else here<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></code> <code> <font color="Blue"><</font>li<font color="Blue">><</font>a <font color="Red">href</font><font color="Blue">="#"></font>Separated link<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></code> <code> <font color="Blue"><</font>li<font color="Blue">><</font>a <font color="Red">href</font><font color="Blue">="#"></font>One more separated link<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></code> <code> <font color="Blue"></</font>ul<font color="Blue">></font></code> <code> <font color="Blue"></</font>li<font color="Blue">></font></code> <code> <font color="Blue"></</font>ul<font color="Blue">></font></code> <code> <font color="Blue"><</font>form <font color="Red">class</font><font color="Blue">="navbar-form navbar-left"</font> <font color="Red">role</font><font color="Blue">="search"></font></code> <code> <font color="Blue"><</font>div <font color="Red">class</font><font color="Blue">="form-group"></font></code> <code> <font color="Blue"><</font>input <font color="Red">type</font><font color="Blue">="text"</font> <font color="Red">class</font><font color="Blue">="form-control"</font> </code> <code>»»»»»»»»»»»»»<font color="Red">placeholder</font><font color="Blue">="Search"></font></code> <code> <font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"><</font>button <font color="Red">type</font><font color="Blue">="submit"</font> <font color="Red">class</font><font color="Blue">="btn btn-default"></font>Submit<font color="Blue"></</font>button<font color="Blue">></font></code> <code> <font color="Blue"></</font>form<font color="Blue">></font></code> <code> <font color="Blue"><</font>ul <font color="Red">class</font><font color="Blue">="nav navbar-nav navbar-right"></font></code> <code> <font color="Blue"><</font>li<font color="Blue">><</font>a <font color="Red">href</font><font color="Blue">="#"></font>Link<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></code> <code> <font color="Blue"><</font>li <font color="Red">class</font><font color="Blue">="dropdown"></font></code> <code> <font color="Blue"><</font>a <font color="Red">href</font><font color="Blue">="#"</font> <font color="Red">class</font><font color="Blue">="dropdown-toggle"</font> <font color="Red">data-toggle</font><font color="Blue">="dropdown"></font></code> <code>»»»»»»»»»»»»Dropdown <font color="Blue"><</font>b <font color="Red">class</font><font color="Blue">="caret"></</font>b<font color="Blue">></</font>a<font color="Blue">></font></code> <code> <font color="Blue"><</font>ul <font color="Red">class</font><font color="Blue">="dropdown-menu"></font></code> <code> <font color="Blue"><</font>li<font color="Blue">><</font>a <font color="Red">href</font><font color="Blue">="#"></font>Action<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></code> <code> <font color="Blue"><</font>li<font color="Blue">><</font>a <font color="Red">href</font><font color="Blue">="#"></font>Another action<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></code> <code> <font color="Blue"><</font>li<font color="Blue">><</font>a <font color="Red">href</font><font color="Blue">="#"></font>Something else here<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></code> <code> <font color="Blue"><</font>li<font color="Blue">><</font>a <font color="Red">href</font><font color="Blue">="#"></font>Separated link<font color="Blue"></</font>a<font color="Blue">></</font>li<font color="Blue">></font></code> <code> <font color="Blue"></</font>ul<font color="Blue">></font></code> <code> <font color="Blue"></</font>li<font color="Blue">></font></code> <code> <font color="Blue"></</font>ul<font color="Blue">></font></code> <code>»»<font color="Blue"></</font>div<font color="Blue">></font></code> <code> <font color="Blue"></</font>nav<font color="Blue">></font></code> </codelisting> <codelisting page="" id="285" header="Listing 7: Code example comparing v2.x and v3.0 button classes"> <code><!--Bootstrap 2--></code> <code> <font color="Blue"><</font>p<font color="Blue">></font></code> <code> <font color="Blue"><</font>button <font color="Red">type</font><font color="Blue">="button"</font> <font color="Red">class</font><font color="Blue">="btn btn-large btn-primary"></font></code> <code>»»»»»v2.x Large button<font color="Blue"></</font>button<font color="Blue">></font></code> <code> »<font color="Blue"><</font>button <font color="Red">type</font><font color="Blue">="button"</font> <font color="Red">class</font><font color="Blue">="btn btn-large"></font></code> <code>»»»»»v2.x Large button<font color="Blue"></</font>button<font color="Blue">></font></code> <code> <font color="Blue"></</font>p<font color="Blue">></font></code> <code> <font color="Blue"><</font>p<font color="Blue">></font></code> <code> <font color="Blue"><</font>button <font color="Red">type</font><font color="Blue">="button"</font> <font color="Red">class</font><font color="Blue">="btn btn-primary"></font></code> <code>»»»»»v2.x Default button<font color="Blue"></</font>button<font color="Blue">></font></code> <code> <font color="Blue"><</font>button <font color="Red">type</font><font color="Blue">="button"</font> <font color="Red">class</font><font color="Blue">="btn"></font></code> <code>»»»»»v2.x Default button<font color="Blue"></</font>button<font color="Blue">></font></code> <code> <font color="Blue"></</font>p<font color="Blue">></font></code> <code> <font color="Blue"><</font>p<font color="Blue">></font></code> <code> <font color="Blue"><</font>button <font color="Red">type</font><font color="Blue">="button"</font> <font color="Red">class</font><font color="Blue">="btn btn-small btn-primary"></font></code> <code>»»»»»v2.x Small button<font color="Blue"></</font>button<font color="Blue">></font></code> <code> <font color="Blue"><</font>button <font color="Red">type</font><font color="Blue">="button"</font> <font color="Red">class</font><font color="Blue">="btn btn-small"></font></code> <code>»»»»»v2.x Small button<font color="Blue"></</font>button<font color="Blue">></font></code> <code> <font color="Blue"></</font>p<font color="Blue">></font></code> <code> <font color="Blue"><</font>p<font color="Blue">></font></code> <code> <font color="Blue"><</font>button <font color="Red">type</font><font color="Blue">="button"</font> <font color="Red">class</font><font color="Blue">="btn btn-mini btn-primary"></font></code> <code>»»»»»v2.x Mini button<font color="Blue"></</font>button<font color="Blue">></font></code> <code> <font color="Blue"><</font>button <font color="Red">type</font><font color="Blue">="button"</font> <font color="Red">class</font><font color="Blue">="btn btn-mini"></font></code> <code>»»»»»v2.x Mini button<font color="Blue"></</font>button<font color="Blue">></font></code> <code> <font color="Blue"></</font>p<font color="Blue">></font></code> <code> </code> <code><!--Bootstrap 3--></code> <code> <font color="Blue"><</font>p<font color="Blue">></font></code> <code> <font color="Blue"><</font>button <font color="Red">type</font><font color="Blue">="button"</font> <font color="Red">class</font><font color="Blue">="btn btn-primary btn-lg"></font></code> <code>»»»»»v3.0 Large button<font color="Blue"></</font>button<font color="Blue">></font></code> <code> <font color="Blue"><</font>button <font color="Red">type</font><font color="Blue">="button"</font> <font color="Red">class</font><font color="Blue">="btn btn-default btn-lg"></font></code> <code>»»»»»v3.0 Large button<font color="Blue"></</font>button<font color="Blue">></font></code> <code> <font color="Blue"></</font>p<font color="Blue">></font></code> <code> <font color="Blue"><</font>p<font color="Blue">></font></code> <code> <font color="Blue"><</font>button <font color="Red">type</font><font color="Blue">="button"</font> <font color="Red">class</font><font color="Blue">="btn btn-primary"></font></code> <code>»»»»»v3.0 Default button<font color="Blue"></</font>button<font color="Blue">></font></code> <code> <font color="Blue"><</font>button <font color="Red">type</font><font color="Blue">="button"</font> <font color="Red">class</font><font color="Blue">="btn btn-default"></font></code> <code>»»»»»v3.0 Default button<font color="Blue"></</font>button<font color="Blue">></font></code> <code> <font color="Blue"></</font>p<font color="Blue">></font></code> <code> <font color="Blue"><</font>p<font color="Blue">></font></code> <code> <font color="Blue"><</font>button <font color="Red">type</font><font color="Blue">="button"</font> <font color="Red">class</font><font color="Blue">="btn btn-primary btn-sm"></font></code> <code>»»»»»v3.0 Small button<font color="Blue"></</font>button<font color="Blue">></font></code> <code> <font color="Blue"><</font>button <font color="Red">type</font><font color="Blue">="button"</font> <font color="Red">class</font><font color="Blue">="btn btn-default btn-sm"></font></code> <code>»»»»»v3.0 Small button<font color="Blue"></</font>button<font color="Blue">></font></code> <code> <font color="Blue"></</font>p<font color="Blue">></font></code> <code> <font color="Blue"><</font>p<font color="Blue">></font></code> <code> <font color="Blue"><</font>button <font color="Red">type</font><font color="Blue">="button"</font> <font color="Red">class</font><font color="Blue">="btn btn-primary btn-xs"></font></code> <code>»»»»»v3.0 Extra small button<font color="Blue"></</font>button<font color="Blue">></font></code> <code> <font color="Blue"><</font>button <font color="Red">type</font><font color="Blue">="button"</font> <font color="Red">class</font><font color="Blue">="btn btn-default btn-xs"></font></code> <code>»»»»»v3.0 Extra small button<font color="Blue"></</font>button<font color="Blue">></font></code> <code> <font color="Blue"></</font>p<font color="Blue">></font></code> </codelisting> </codelistings> <pages> <page id="1" title=""/> <page id="2" title=""/> <page id="3" title=""/> <page id="4" title=""/> <page id="5" title=""/> <page id="6" title=""/> <page id="7" title=""/> </pages> </document>