【问题标题】:Placeholder property of HTML not working properly in IE10HTML 的占位符属性在 IE10 中无法正常工作
【发布时间】:2015-09-30 09:34:16
【问题描述】:

请考虑下面的代码。

<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
     <input type="text" name="fname" placeholder="First name"><br>
</body>
</html>

这在 Chrome 和 Firefox 中运行良好。但在 IE 10 中,占位符文本以斜体显示。我想要普通字体样式的 IE10 中的占位符文本。

【问题讨论】:

    标签: javascript html css internet-explorer placeholder


    【解决方案1】:

    在 IE 中,您可以按如下方式设置占位符:

    input:-ms-input-placeholder {
        font-style:normal
    }
    

    【讨论】:

      猜你喜欢
      • 2013-09-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-05
      相关资源
      最近更新 更多