bootstrap printing width

前端 未结 3 509
旧巷少年郎
旧巷少年郎 2021-02-12 11:00

I\'m using bootstrap in an app and as you can see (below) when printing the browser (left side) is using a really small width when printing (right) so the responsive layout is m

相关标签:
3条回答
  • 2021-02-12 11:27

    I had a very similar problem. Ensuring the responsive css is enabled only for media="screen" solved it.

    <link href="assets/css/bootstrap-responsive.css" rel="stylesheet" media="screen">
    
    0 讨论(0)
  • 2021-02-12 11:35

    Getting rid of the responsive style is the answer! thanks a lot !

    I'm using rails twitter bootstrap, that recompiles the less sources, so just a little note to say that it works like this too (first line of bootstrap_and_overrides.css.less):

    @import "twitter/bootstrap/bootstrap.less";
    @media screen {
        @import "twitter/bootstrap/responsive.less";
    }
    

    oops: edit, it works fine in development, but brings error when compiling for production... had to build 2 distinct bootstrap_and_overrides for screen and print version (looking for a cleaner solution)

    0 讨论(0)
  • 2021-02-12 11:42

    For Bootstrap 3, this solved my problem:

    @media print {
      .container {
        width:100%;
      }
    }
    
    0 讨论(0)
提交回复
热议问题