如何让占位符填充正常工作?

时间:2016-10-27 08:02:34

标签: css internet-explorer placeholder

在尝试设置占位符样式时,我在IE上遇到了意外行为。

在它周围玩耍似乎填充仅用于占位符,影响了整个输入元素。与margin相同。

任何合理的解决方法?

编辑代码实际上是一个mixin,由多个input使用。我不能只是对值进行硬编码,它需要与原始值相关。

input {
   padding: 5px 72px;
   background: linear-gradient(to right, rgba(41, 184, 229, 1) 0%, rgba(188, 224, 238, 1) 28%, rgba(188, 224, 238, 1) 72%, rgba(41, 184, 229, 1) 100%);
	border: none;
	outline: none;
}
	input::-webkit-input-placeholder {
		color: red;
		font-weight: bold;
		padding: 0 15px;
	}
	input:-ms-input-placeholder {
		color: red;
		font-weight: bold;
		padding: 0 15px;
	}
<input placeholder="mandatory" />

0 个答案:

没有答案
相关问题