Setting max width for body using Bootstrap

前端 未结 5 455
时光说笑
时光说笑 2020-12-22 17:46

I\'m building my first site with Twitter Bootstrap and experimenting with fluid layouts. I\'ve set my container to be fluid, now the content inside takes up the full page wi

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-22 18:21

    Unfortunately none of the above solved the problem for me.

    I didn't want to edit the bootstrap-responsive.css so I went the easy way:

    1. Create a css with priority over bootstrap-responsive.css
    2. Copy all the content of the @media (min-width: 768px) and (max-width: 979px) (line 461 with latest bootstrap version 2.3.1 as of today)
    3. Paste it in your high priority css
    4. In your css, put @media (min-width: 979px) in the place where it said @media (min-width: 768px) and (max-width: 979px) before. This sets the from 768 to 979 style to everything above 768.

    That's it. It's not optimal, you will have duplicated css, but it works 100% perfect!

提交回复
热议问题