search
LoginSignup
32

More than 5 years have passed since last update.

posted at

印刷時とりあえずA4 1枚に収めるための最小限のCSS

やっつけ感ありますが、とりあえずA4 1枚に収まります。

@media print {
    // 印刷したくない領域
    .hidden-print {
        display: none;
    }
    // 印刷したい領域
    .content-print{
        top:0 !IMPORTANT;
        left:0 !IMPORTANT;
        width:172mm !IMPORTANT;
        height:251mm !IMPORTANT;
    }
}

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
32