占位符不与Internet Explorer一起使用

编程入门 行业动态 更新时间:2024-10-26 15:13:12
本文介绍了占位符不与Internet Explorer一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我一直在挣扎几个小时,我需要了解为什么我的网站(使用Drupal 7.50)没有在Internet Explorer 11上显示任何占位符?

我已经尝试了很多我见过的东西,就像这些:

  • 本网站(hagenburger)出现此错误
  • $ b

    语法错误,无法识别的表达式:'[placeholder]'

    • mathiasbynens这个github项目,

    我也尝试从其他stackoverflow帖子定制Javascript,但这些占位符仍未显示。

    我也试着改变CSS,但没有成功:

    : - ms-输入占位符{ / * IE10-11 * / 颜色:#ccc!important; font-weight:400!important; } :: - ms-input-placeholder {/ * Edge * / color:#ccc; font-weight:400; } :: placeholder {/ * CSS工作草案* / 颜色:#ccc; font-weight:400; }

    我真的迷失了,一直在挣扎,解决这个问题?

    编辑

    这是一个例子我使用的输入:

    < input required =requiredplaceholder =Votreâge(例如:28) class =form-control form-text requiredid =edit-submitted-agename =submitted [age]value =size =60maxlength =128autocomplete =offtype = 文本 >

    更新

    我可能找到了一种方法,但我不确定,当我将站点兼容模式从9(默认值)更改为10或11时,我发现它正在工作。因此,如果有方法设置兼容性模式当访问网站,然后解决。

    解决方案

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

    < ; 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 :

    • This website (hagenburger) where I got this error

    Syntax error, unrecognized expression: '[placeholder]'

    • This github project by mathiasbynens which didn't help.

    I also tried custom Javascript from other stackoverflow 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.

    更多推荐

    占位符不与Internet Explorer一起使用

    本文发布于:2023-11-17 03:48:34,感谢您对本站的认可!
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:不与   Internet   Explorer

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!