2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

paint-order が Chrome で実装されるので、HTML+CSSで縁取り文字

Posted at

もともとSVGではできていましたが、Chrome123がHTMLでのpaint-orderに対応するようなので、プラウザ互換を気にせずに使えるようになりそうです。白系の背景に白文字を乗せるときとかに重宝します。

See the Pen paint-order by lhankor_mhy (@lhankor_mhy) on CodePen.

上の文字がpaint-orderの指定なし、下の文字がpaint-order: strokeです。

div{
  color: white;
  -webkit-text-stroke: #00000066 4px;
}
div+div{
  paint-order: stroke;  
}

Illustrator とかを使ってれば、あーあれね、という感じになるかと思いますが、線を塗りの後ろに回すやり方です。たぶん、Illustrator9 あたりのアピアランスとかで使えるようになった機能だと思うんですが、それまでは同じ文字を2つ書いてレイヤーで重ねたような記憶があります。なつい。

2
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?