LoginSignup
0
0

More than 1 year has passed since last update.

HTML印刷時の白抜き文字の色について

Last updated at Posted at 2022-10-01

HTMLの画面を印刷したい時に、あることに気が付いた

Chromeにて、
背景の印刷の項目にチェックを入れなければ、CSSにて「color:white」になっている白文字の要素は、グレーの文字になってしまう。
調べてみるとブラウザが勝手にしているようで他の人もそういった問題に悩まされているようだ。

お客様に提出する画面であれば、チェックを入れさせるというのはあまりしたくない

ふと、「color:white」を使わずに白抜き文字を使用できないか考えたところ、

color: transparent;
text-shadow: 0 0 white;

にて印刷時も白抜き文字にできることが可能であった
確認バージョン:
chrome 106.0.5249.91(Official Build)

0
0
0

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
  3. You can use dark theme
What you can do with signing up
0
0