DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Data Engineering
  3. Databases
  4. Getting Started With Bootstrap

Getting Started With Bootstrap

Bootstrap is a free, open source framework built with HTML, CSS, and JS to develop responsive web design. It offers an extremely powerful framework developed to facilitate faster and easier web development. Let's see what it's all about!

Josh Anderson user avatar by
Josh Anderson
·
Feb. 11, 16 · Tutorial
Like (3)
Save
Tweet
Share
5.87K Views

Join the DZone community and get the full member experience.

Join For Free

bootstrap is a free, open source framework built with html, css, and js to develop responsive web design. it offers an extremely powerful framework developed to facilitate faster and easier web development.

a little bit of history

bootstrap was developed by mark otto and jacob thornton of twitter and as the pair wanted to avoid the inconsistencies involved in the creation of internal tools. previously, there was no set of code structure used by the various teams within twitter, and this led the company to develop the framework originally known as 'twitter blueprint'. this standard could be used seamlessly across the company by all developers when they built new tools.

in 2011 , twitter blueprint was released as bootstrap, an open source project on github. since then, it has been maintained by mark otto and jacob thornton, as well as a large community of open source developers.

in 2012 , bootstrap 2 was released with the 12 columns grid layout and lots of reusable components.

in 2013 , bootstrap 3 was released with a flat design and supported mobile first design.

bootstrap provides more than a dozen reusable components for web development, these are completely reusable and easily customizable. whether you wish to work on the user interface of a component or its functionality, both can be achieved by customizing their underlying css and javascript respectively. bootstrap provides some of the basic components which are used in any normal web applications like dropdowns, button groups, bread crumb, labels, page headers, list groups, etc. as well as more advanced components such as accordion, panels, progress bars, glyphicons, etc. you can view the available components under bootstrap over here .

in this post, we will explain how to use bootstrap in an asp.net mvc app.

getting started

install using nuget

bootstrap is available by default with visual studio 2013 and asp.net mvc 5. there is a nuget package available for bootstrap (i have version 3.0.0 installed).

install manually

you can also manually download the bootstrap from here . extract the files and you should see the following folder structure of the extracted zip.

bootstrap-3.3.5-dist

1.    css

2.    fonts

3.    js

install using bower

$ bower install bootstrap

install using npm

$ npm install bootstrap

about the grid

using the bootstrap grid system, we can easily create the page layout structure. with bootstrap 3, it is possible to create a dynamic and responsive page layout and it scales around 12 columns based on different devices such as desktops, tablets, or cellphones.

bootstrap provides different classes for each type of devices. below is the prefix of the classes used for different type of devices:

device type

class prefix

resolution

extra small devices (cell phones)

.col-xs-

<768px

small devices (tablets)

.col-sm-

>768px

medium devices (laptops)

.col-md-

>992px

large devices (desktops)

.col-lg-

>1200px

now, let’s say we want to create a page layout with 2 columns. our div structure would look something like this:

   <div class="container">

             <div class="row">
                 <div >row 1 column 1</div>
                 <div > row 1 column 2</div>
             </div>

             <div class="row">
                 <div> row 2 column 1</div>
                 <div> row 2 column 2</div>
             </div>
         </div>

so, if we use the class prefix as .col-xs- for each column div, bootstrap will apply the style not only for extra small devices but also for small, medium, and large devices too—which is pretty neat.

now, if we want to show columns side by side in bootstrap, we have to mark the div styles as per devices to be supported. for demo purposes, we will have this supported for all device types and so we will use the class prefix as .col-xs-*. also, since bootstrap supports 12 columns in layout, * in the class has to be replaced with a number less than 12 and all the columns prefix (*) total in the particular row should be 12.

         <div class="container">

             <div class="row">
                 <div  class="col-sm-6">row 1 column 1</div>
                 <div  class="col-sm-6"> row 1 column 2</div>
             </div>

             <div class="row">
                 <div class="col-sm-3"> row 2 column 1</div>
                 <div class="col-sm-9"> row 2 column 2</div>
             </div>
         </div>

so, in this case, the first row will have two columns of width in ratio 1:1 and the second row will have columns in the ratio of 3:9. in this way, we can create the page layout with 12 columns supported using bootstrap.

useful tools

the following tools are very useful for developers to build user interface for applications using bootstrap. you can leave the wire framing tool behind and instead use one of these:

1. jetstrap – this is a premier interface building tool for bootstrap. it is 100% web based with a variety of code snippets available and you can use complex components quickly. you can drag and drop the elements, create a responsive design, and can create one free project with unlimited screens.

2. brix – this is also 100% web based and provides various ready-to-use templates in addition to the reusable components. you can select one of the templates and start customizing as per your needs. the live testing feature is very useful on this site.

3. bootsnipp – bootsnipp provides you with a web based tool for creating bootstrap screens. in addition to the templates, it also provides various forms which are commonly used in applications like login, registration, contact, etc. it also has a very responsive editable grid and various email templates.

bootstrap made web development easy!

with bootstrap, web development with responsive design is so much easier. with microsoft providing support for bootstrap directly within visual studio, its popularity has grown over the last year and has been very helpful to a lot of people:

1. one framework for all devices – with bootstrap responsive design you can provide your webpage with support for different devices.

2. browser support – bootstrap works with all modern browsers like mozilla firefox, google chrome, safari, internet explorer, and opera. you can find more information on browser support over here .

3. quick to start – with the framework already in place, developers can jump straight into development with the available bootstrap templates

4. javascript, html5, & css3 – bootstrap is built on html5, css3, and javascript. hence, one does not need knowledge of complex technologies to work with bootstrap.

5. open source – it is free to use and is supported and backed by a large community of developers.

Bootstrap (front-end framework) Open source Column (database) mobile app

Published at DZone with permission of Josh Anderson, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • ChatGPT: The Unexpected API Test Automation Help
  • Fraud Detection With Apache Kafka, KSQL, and Apache Flink
  • Select ChatGPT From SQL? You Bet!
  • Express Hibernate Queries as Type-Safe Java Streams

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: