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

【CSS】スマホを横にしたときに文字が大きくならないようにする -webkit-text-size-adjust : 100%

Last updated at Posted at 2021-02-04

iPhone や Android のブラウザは、縦向き (Portrate mode) や横向き (Landscape mode) にすると文字サイズを自動調整する機能があります

ただ、それがかえって読みづらい場合は、文字の大きさが変わらないように制御してあげる必要があります

CSS の -webkit-text-size-adjust で制御可能です

-webkit-text-size-adjust

使い方

デフォルトはautoで文字の大きさが自動調整されるようになっています
これを100%で指定します

body {
  -webkit-text-size-adjust: 100%;
}

これで文字の大きさは縦横変わらなくなります

ちなみにnoneを指定するとスマホはいいのですが、PCで拡大表示にしたときに文字の大きさだけが拡大されず、表示に支障が出ます

-webkit-text-size-adjust: none

文字の大きさはサイトの見やすさに大きく影響します
読みやすいストレスのないサイトにするために-webkit-text-size-adjustを設定しましょう

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?