2017-08-10 82 views
1

按照以下圖片在Chrome瀏覽器中,佔位符不能很好地工作......它滑向左側。佔位符在Chrome瀏覽器中看起來很奇怪,如何解決

我該如何解決這個問題。

我沒有使用任何CSS的佔位符

代碼就像

<input type="text" name="users_address" placeholder="Address" required="">

enter image description here

+1

https://css-tricks.com/almanac/selectors/p/placeholder/ – 2017-08-10 09:48:23

+1

請提供填充或TEXT-INDENT輸入 –

回答

1

僅供鉻,

::-webkit-input-placeholder {text-indent:15px;}

+0

無WebKit的輸入 - 佔位符在我的Chrome中工作正常 – Kondal

+0

什麼是舊版Chrome? @Kondal它是否適用於所有版本? –

3

不知道爲什麼它會發生,你可以添加此代碼在您的css

input::placeholder, 
input::-webkit-input-placeholder, 
input::-moz-placeholder, 
input::-ms-input-placeholder { 
    text-indent:10px; 
} 
1

如果您在默認功能中遇到問題,那麼爲什麼不使用JS解決方案,它將工作於所有瀏覽器?我使用了這個plugin,它可以在大多數瀏覽器中使用。

相關問題