Skip to content

Instantly share code, notes, and snippets.

@okuden-labo
Last active August 29, 2015 14:17
Show Gist options
  • Save okuden-labo/d44b2b194d14fc99926e to your computer and use it in GitHub Desktop.
Save okuden-labo/d44b2b194d14fc99926e to your computer and use it in GitHub Desktop.
Bootstrap Containerのサイズをカスタムする方法[改訂版]
/* 通常のcontainerが750px-970px-1170pxなのでsmallの間にmiddeleを追加 */
@media (min-width: 768px) {
.container-small {
width: 300px;
}
.container-middle {
width: 500px;
}
}
@media (min-width: 992px) {
.container-small {
width: 500px;
}
.container-middle {
width: 700px;
}
}
@media (min-width: 1200px) {
.container-small {
width: 700px;
}
.container-middle {
width: 900px;
}
}
/* 作成したカスタムコンテイナーがウィンドウ幅からはみ出ないように調整*/
.container-small,
.container-middle {
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
max-width: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment