Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What is the difference between (div class="container") and (div class="container-fluid") in bootstrap ?

user-image
Question added by medhatmahmoud mahmoud , Web Designer , Connect Computer Service Co
Date Posted: 2015/05/21
Ibrahim Saleh
by Ibrahim Saleh , Front End Developer , Souq.com

http://stackoverflow.com/questions//container-fluid-vs-container

 

This is the answer ... check it out

GhouSe Shaik
by GhouSe Shaik , Web Developer , Fortune System Solutions

in bootstrap .container has fixed width for each screen like xs,sm,md and lg where .container-fluid expands to fill the available width...

Khushnudul Haque
by Khushnudul Haque , Front End Developer , Saffron9 Pvt. Ltd.

.container class has fixed width for all the screen sizes like mobile, tablet and desktop but .container-fluid class has full width and it is responsive too.

Deleted user
by Deleted user

When you give Container in div class the frame size will be fixed for all screen.

and if you give container_fluid in div class frame size will take the size of screen pannel

Hassaan Shuja
by Hassaan Shuja , Full Stack Developer , Al Ajyal Group

container class represents  fixed width according to screen viewed, container-fluid on the other hand , will constantly resize as you resize your browser width.

Deleted user
by Deleted user

<div class="container"> it will bring your container to the center of your viewport 

where as

<div class="container-fluid"> streaches the container to the full width of the viewport

Reshma Nambiar
by Reshma Nambiar , Business Analyst , Paragon Shipping & Logistics

.container is more oe less like achieving reponsive view with media query. The viewport width remains fixed for specific screen sizes whereas .container-fluid the width of the viewport keeps on changing even with a slightest change in the screen / browser size.

Syed Asghar Ali
by Syed Asghar Ali , Software Consultant , Ahad Technologies

The difference between container and container-fluid comes from these lines of CSS:

@media (min-width: 568px) { .container { width: 550px; } } @media (min-width: 992px) { .container { width: 970px; } } @media (min-width: 1200px) { .container { width: 1170px; } }

Depending on the width of the viewport that the webpage is being viewed on, the container class gives its div a specific fixed width. These lines don't exist in any form for container-fluid, so its width changes every time the viewport width changes.

So for example, say your browser window is 1000px wide. As it's greater than the min-width of 992px, your .container element will have a width of 970px. You then slowly widen your browser window. The width of your .container won't change until you get to 1200px, at which it will jump to 1170px wide and stay that way for any larger browser widths.

Your .container-fluid element, on the other hand, will constantly resize as you make even the smallest changes to your browser width.

Farhan Noor
by Farhan Noor , Senior WordPress Developer , Spider Teams LLC

Container class is to make website or an element fixed widith.

Container-fluid class makes your website or an element 100% wide in a browser.

Gurwinder Gurwinder Singh
by Gurwinder Gurwinder Singh , Web developer & designer , techturners

yes,  <div class="container-fluid"> is% width of your row. 

and <div class-"container"> is responsive width of row. like we can say we use in html ,css  .center class for width:% on all website.  <div class="container">  works that.

 

you can search  bootstarp on google ..you will find  all informations with example.

Kaushali Shanika De Silva
by Kaushali Shanika De Silva , Software Engineer , ITSthe1 Solutions LLC

Container fluid cover the whole width of the screen while container cover the maximum 1320 px

More Questions Like This