【发布时间】:2016-06-17 16:36:27
【问题描述】:
我想在占位符后面放一个红星。 Chrome 和 Safari 都可以,但不能在 Firefox 上运行。 我做的是
input::-webkit-input-placeholder:after { content: "*";
color: red; }
input::-moz-placeholder:after { content: "*";
color: red; }
input:-ms-input-placeholder:after { content: "*";
color: red; }
在 CSS 和
中<div class="form-group">
<input type="text" name="username" id="username" tabindex="1" class="form-control" placeholder="Email" >
</div>
在 HTML 中。
为什么在 Firefox 中Email 后面什么都没有。
【问题讨论】:
-
链接中的内容是:::-webkit-input-placeholder:after { content: "*";红色;不是:input::-webkit-input-placeholder:在我不熟悉css中的“::”语法之后,但如果你只是按照示例进行操作,它可能会起作用。
-
@sscotti,他们是一样的
-
现在我发现chrome和safari都很好。只是chrome有问题。
-
不确定您是否在 mozilla 中得到了答案。如果没有,这可能会有所帮助:link,来自另一个堆栈溢出帖子。