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

后端 未结 5 1859
情歌与酒
情歌与酒 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:09

    If you don't wish to compile bootstrap, copy the following and insert it in your custom css file. It's not recommended to change the original bootstrap css file. Also, you won't be able to modify the bootstrap original css if you are loading it from a cdn.

    Paste this in your custom css file:

    @media (min-width:992px)
        {
            .container{width:960px}
        }
    @media (min-width:1200px)
        {
            .container{width:960px}
        }
    

    I am here setting my container to 960px for anything that can accommodate it, and keeping the rest media sizes to default values. You can set it to 940px for this problem.

提交回复
热议问题