【发布时间】:2018-03-03 14:37:11
【问题描述】:
在这个简单的网站 (www.enverter.com) 上,input type="text" 在 Internet Explorer 10 中不起作用。但是,它在 Chrome 和 Safari 中运行良好。
我的意思是:“文本”输入类型(带有一些自定义样式)的引导表单控件不在 Internet Explorer 10 和 FireFox 中显示文本,但在 Chrome、Safari 和 Edge 中按预期显示。
我不确定这是引导问题还是我遗漏的其他问题。我确实在 head 部分的开头设置了以下元标记,并且我使用的是 bootstrap 3.3.4 版本。
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
我在控制台中没有看到任何错误。
这里是 JSFiddle:https://jsfiddle.net/pjdixit/kfev4rss/
谁有解决方法的指点?
完整的代码贴在下面
<!DOCTYPE html>
<html>
<head>
<title> Bootstrap Form Control Not working in Internet Explorer and Safari</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<style>
.CustomInputStyle
{
text-align: center;
margin-top: 20px;
padding: 25px;
font-size:24px;
font-weight:bold;
}
</style>
</head>
<body>
<div>
<h1 class="text-center">
Bootstrap Form Control (with some custom styling) rendering error in Internet Explorer and Safari
</h1>
<h3 class="text-center">
Test to find out why Bootstrap Form Control of "text" input type (with some custom styling) is not displaying text in Internet Explorer 10 and Safari but displays as expected in Chrome, Edge and Safari.
</h3>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="form-group">
<div class="row">
<div class="col-md-12">
<h3 style="color:red"> Test: </h3>
<br>
</div>
</div>
<div class="row">
<div class="col-md-6">
<input type="text" class="form-control CustomInputStyle" value="Test input 1">
</div>
<div class="col-md-6">
<input type="text" class="form-control CustomInputStyle" value="Test input 2">
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
【问题讨论】:
-
你能摆弄一下吗?
-
它在 Firefox 中也不起作用(意思是,输入字段不显示您输入的内容)。你能提供你的代码吗?
-
发帖时我无法访问开发计算机。明天我会做更多的测试,并尝试缩小问题范围并将其发布在 JSFidde 上。谢谢@
-
太棒了 - 还有……您可能想详细说明不工作。这是没有意义的,并且迫使我们做额外的工作来弄清楚到底是什么不工作,以及错误是什么。
-
@PeterAbolins:我的意思是“文本”输入类型(带有一些自定义样式)的引导表单控件不在 Internet Explorer 10 中显示文本,但在 Chrome、Safari 和边缘。
标签: javascript html twitter-bootstrap-3 internet-explorer-10