Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Beginner seeks help on optimizing bootstrap theme for mobile devices. Reply To: Beginner seeks help on optimizing bootstrap theme for mobile devices.

#234909
TheDoc
Member

You’ll want to read about media queries: https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries

In your simple case, you’ll probably want to target when your main navigation switches to the mobile version. So you’d write something like this:

@media (max-width: 767px) {
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }
}

In Sass it could look like this:

.container {
  padding: 80px 120px;

  @media (max-width: 767px) {
    padding-left: 15px;
    padding-right: 15px;
  }
}