LoginSignup
2
3

More than 5 years have passed since last update.

Bootstrap3のスマホ表示時の余白を狭くする

Last updated at Posted at 2016-11-05

Bootstrap3のgrid systemを使用すると, レスポンシブデザインが容易に実現できるのだが, 画面の横幅が768px未満のとき(スマホ用表示のときに)画面横の余白が大きく感じるのが玉に瑕.

それを是正するには, 以下のようにすればOK.

@media (max-width: 767px) {
  .container  {
    padding: 3px !important; /* 好みに応じて余白サイズを指定 */
    overflow-x: hidden !important; /* これがないと x軸方向に謎の余白が生じてしまう */
  }

  .navbar-header {
    margin: 0px  !important;
  }
}
2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3