似乎在 Opera 和 Chrome 中运行良好,但在 FF 和 IE11 中相同的代码隐藏了文本,这一点都不好玩。我没有 Mac,所以我不知道 Safari 中的情况。
Here is a plunker demonstrating the issue.
我试过添加 line-height
和 overflow:visible
但似乎都没有太大效果。
CSS:
#userResponse {
font-size: 2em;
padding: 1em 0.25em;
text-align: center;
}
html:
<!DOCTYPE html>
<html>
<head>
<link data-require="bootstrap-css@3.3.1" data-semver="3.3.1" rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" />
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
</head>
<body>
<input class="form-control" id="userResponse" type="text">
</body>
</html>
最佳答案
Bootstrap 也有输入标签的类来增加文本字段的高度,试试input-lg
,希望它能满足你的要求
<input class="form-control input-lg" type="text">
记得把所有的form-control
放在form-group
里面
<div class="form-group">
<input class="form-control input-lg" type="text">
</div>
关于html - 带有自定义填充的文本输入的 Bootstrap 3 表单控制类在 IE 和 FF 中隐藏文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27566118/