Bootstrap provides a fixed-width layout design that you can use for a website of 1170 pixels wide. Here's how to set up your layout:
- Open your Bootstrap CSS file and find the @media (min-width: 1200px) entry. If this does not exist, insert this code into the stylesheet:
@media (min-width: 1200px) {
.container {
width: 1170px;
}
}
- Change the margin-left margins for all columns in the same media query to match the distance you want from the left and right:
@media (min-width: 1200px) {
.col-md-1,
.col-md-2,
.col-md-3,
.col-md-4,
...
.col-md-12 {
float: left;
margin-left: 15px;
margin-right: 15px;
}
}
- Adjust the grid fractions (column numbers) accordingly. For example, if you have a two-column layout (md-12) and you want 1170px width, the fractions would need to be adjusted to be able to fit into 1170px:
@media (min-width: 1200px) {
.col-md-12 {
width: 58.5%;
}
.col-md-6 {
width: 29.25%;
}
...
}
For more information and detailed instructions on how to configure Bootstrap's fixed-width layouts, please refer to this guide:
https://getbootstrap.com/docs/4.0/layout/overview/#fixed-width-layouts