Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap container width change

I'm using Bootstrap for my website and I need to create a container with size of 1250px, but the problem is when I change the class of Bootstrap container the responsiveness won't work anymore.

What should I do?

like image 444
Dennis Avatar asked Nov 15 '14 16:11

Dennis


People also ask

How do you set the width of a container?

Using width, max-width and margin: auto; Then, you can set the margins to auto, to horizontally center the element within its container. The element will take up the specified width, and the remaining space will be split equally between the two margins: This <div> element has a width of 500px, and margin set to auto.

How do I change the width of a row in Bootstrap?

Also, you must use . col-md-6 like class to specify width of your section within a row where md is replaceable by lg and sm as well. md stands for Medium sized devices like laptop,desktop etc.


1 Answers

Just setting 'container-fluid' will create a 100% width container. Wrapping the whole thing in a 1250px width container will cause your container not to be responsive. The best thing to do is to assign a 'max-width' to your fluid container, I've included the markup below:

<div class="container-fluid" style="background-color:#CDCDCD; max-width:1250px">

Container-Fluid

like image 159
eroedig Avatar answered Oct 11 '22 04:10

eroedig