Bootstrap 3 - Set Container Width to 940px Maximum for Desktops?

后端 未结 5 1868
情歌与酒
情歌与酒 2020-12-13 02:26

I am adding a whole new section to a website using Twitter Bootstrap 3, however the container cannot go wider than 940px in total for Desktop - as it will throw out the Head

5条回答
  •  余生分开走
    2020-12-13 03:32

    There is a far easier solution (IMO) in Bootstrap 3 that does not require you to compile any custom LESS. You just have to leverage the cascade in "Cascading Style Sheets."

    Set up your CSS loading like so...

    
    
    

    Where /css/custom.css is your unique style definitions. Inside that file, add the following definition...

    @media (min-width: 1200px) {
      .container {
        width: 970px;
      }
    }
    

    This will override Bootstrap's default width: 1170px setting when the viewport is 1200px or bigger.

    Tested in Bootstrap 3.0.2

提交回复
热议问题