Bootstrap CSS Fixed Width

[code lang=”css”]
/* 1. non-responsive */
.container { width: 1170px !important; }
.container .navbar-header, .container .navbar-collapse { margin-right: 0; margin-left: 0; }

/* Always float the navbar header */
.navbar-header {
float: left;
}

/* Undo the collapsing navbar */
.navbar-collapse {
display: block !important;
height: auto !important;
padding-bottom: 0;
overflow: visible !important;
}

.navbar-brand {
margin-left: -15px;
}

/* Always apply the floated nav */
.navbar-nav {
float: left;
margin: 0;
}
.navbar-nav > li {
float: left;
}
.navbar-nav > li > a {
padding: 15px;
}

/* Redeclare since we override the float above */
.navbar-nav.navbar-right {
float: right;
}
[/code]

Chandra Oemaryadi has written 244 articles

2 thoughts on “Bootstrap CSS Fixed Width

  1. Septu Jamasoka says:

    Udah pernah coba belum kalau diganti di media queries-nya saja?

    Soalnya konsep dalam bootstrap dia menggunakan media queries sehingga ketika ukuran tertentu, maka akan menerapkan css sesuai dengan ukuran tersebut.

    1. Chandra Oemaryadi says:

      Style CSS di atas mematikan fungi media queries, soalnya dipaksa lebar container selalu 1170px.

      Karena media queries mati, layout nya jadi fixed width / tidak responsif.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>