且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

占位符不与Internet Explorer一起使用

更新时间:2023-09-19 10:35:22

终于找到了解决这个问题的方法,仿真默认设置为9在调试器的屏幕上,即使Internet Explorer 11正在使用,所以我将它添加到HTML的头标记中。

 &lt ; meta http-equiv =X-UA-Compatiblecontent =IE = 11> 

将兼容格式更改为IE11。


I've been struggling for some hours now and I need to understand, why my website (using Drupal 7.50) isn't showing any placeholder on Internet Explorer 11?

I've already tried lots of things I've seen, just as these :

Syntax error, unrecognized expression: '[placeholder]'

I also tried custom Javascript from other *** posts but those placeholder are still not shown.

I also tried to change the CSS just as this but without success :

:-ms-input-placeholder { /* IE10–11 */
    color: #ccc !important;
    font-weight: 400 !important;
}

::-ms-input-placeholder { /* Edge */
    color: #ccc;
    font-weight: 400;
}

::placeholder { /* CSS Working Draft */
    color: #ccc;
    font-weight: 400;
}

I'm really lost and been struggling for a while, any suggestions on how to resolve this issue ?


EDIT

Here's an exemple of an input I'm using:

<input required="required" placeholder="Votre âge (ex:28)" class="form-control form-text required" id="edit-submitted-age" name="submitted[age]" value="" size="60" maxlength="128" autocomplete="off" type="text">


UPDATE

I might found a way but I'm not sure, I saw that it's working when I change the site compatibility mode from 9 (default) to 10 or 11. So if there is a way to set a compatibility mode when accessing the website then it's resolved.

Finally found how to resolve this issue, the emulation was set at 9 as default on the debugger's screen even if internet explorer 11 was being used, so I added this on the head tag of the HTML.

<meta http-equiv="X-UA-Compatible" content="IE=11">

Which changes the compatability format to IE11.