1

そのため、流動的なレスポンシブ デザインに取り組んでおり、ウェブサイトのテキスト サイズは % に基づいて機能します。印刷しようとすると(cmd + p)、ウェブサイトのデザインがクロムで壊れることに気付きました。かなり古い既知の問題のように見えますが、これを機能させるハックをオンラインで見つけることができませんでしたか? これについて何か提案してもらえますか?

ここで言及されている問題: https://code.google.com/p/chromium/issues/detail?id=382313 ローカルの HTML ページに配置して、Chrome で印刷を試すことができる HTML は次のとおりです。

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <style>
        .vmin {
    font-size: 10vmin;
}

.px {
    font-size: 20px;
}

.vw {
    font-size: 10vw;
}

.vh {
    font-size: 10vh;
}

.box {
    width: 10vw;
    height: 10vh;
    border: 1px solid #000;
}
    </style>
</head>
<body>
<div class="vmin">
    using vmin - font-size: 10vmin;
</div>
<div class="px">
    using px - font-size: 20px;
</div>
<div class="vw">
    using vw - font-size: 10vw;
</div>
<div class="vh">
    using vh - font-size: 10vh;
</div>
<div class="box">
    inside box - box size: 10vw x 10vh;
</div>
</body>
</html>

印刷が呼び出されたときにハードコードされたビューサイズを渡す方法があれば、それも問題でしたか?

4

1 に答える 1

1
<style media="screen">
.vmin {
    font-size: 10vmin;
}

.px {
    font-size: 20px;
}

.vw {
    font-size: 10vw;
}

.vh {
    font-size: 10vh;
}

.box {
    width: 10vw;
    height: 10vh;
    border: 1px solid #000;
}
</style>

<style media="print">
        /* Here be CSS applied exclusively when the page is printed */
</style>

http://htmldog.com/references/html/tags/style/

于 2016-01-21T08:13:39.777 に答える