解決IE不支援placeholder的問題

2021-08-15 11:11:59 字數 903 閱讀 1190

專案中遇到placeholder不支援ie10及ie10以下的問題,試了幾種方法,今天整理出來分享給大家,如果有不合適的地方,希望大家提出意見以便改正。

效果如下:

1.第一種辦法:使用html新增的屬性「data-」來實現的,實現的時候沒有用placeholder這個屬性,但是可以實現一樣的效果。

*

.fl.fr

.clearfix:after

.clearfix

.userbox

.userbox li

.userbox li.clearright

.userbox li input

/*這是相容各個瀏覽器的placeholder顏色,也可以設定字型*/

.userbox li input::input-placeholder

.userbox li input::-webkit-input-placeholder /* webkit, blink, edge */

.userbox li input:-moz-placeholder /* mozilla firefox 4 to 18 */

.userbox li input::-moz-placeholder /* mozilla firefox 19+ */

.userbox li input:-ms-input-placeholder /* internet explorer 10-11 */

/*這是修改placeholder預設的顏色*/

.input-placeholder

ie不支援max height的解決之法

div 這樣就可以讓div在ie和firefox中都實現max height的效果 div 這樣就可以讓div在ie和firefox中都實現max height和min height的效果 html head title title head body div style max height 30...

解決IE6不支援position fixed屬性

最近在優化 浮動廣告時候遇見了ie6不支援position fixed屬性。上網收集了一下解決方案 比較好的方案就是利用css表示式進行解決 補充 css expression css 表示式 是一種使用動態設定 css 屬性的方式,並且被 ie5 以上的版本所支援,但是 ie8 的標準模式已不再支...

完美解決IE6不支援position fixed

廢話不多說,先看一下下面這段 以上這段 在網上很常見,通過設定html和body來實現ie6下position fixed效果,但這種辦法有個缺陷,那就是 這會使頁面上原有的absolute relation都變成fixed的效果,在這裡我就不做demo了,如果有懷疑,可以自己去試驗一下。於是我找了...