7
3

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 5 years have passed since last update.

iOS・Safari・Androidブラウザでplaceholderの位置がずれる件

Posted at

事象

chromeやIEでは、「半角数字3桁」と書かれているplaceholderは
ちゃんと真ん中に位置しているのに、、

image.png

safariとiOS・Androidブラウザで見ると・・・

image.png

ん・・・、 真ん中より上になってる。。。。

## 解決方法

簡単です。一行で解決できます。

input::-webkit-input-placeholder { padding-top: 0.2em; }

注意しないといけないのは、
padding-topの値をSafari/iOSとAndroidブラウザをみながら
調整をしなければならないことです。

Safari/iOSが真ん中になっても、
Androidブラウザではずれていることがあるので、
細かく調整してみてください。

7
3
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
7
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?