【发布时间】:2019-09-06 19:40:31
【问题描述】:
-webkit-autofill 伪类在桌面 Chrome 中工作正常,但在移动 Chrome (IOS) 中不起作用
我有一个自定义浮动占位符框架,我希望它支持 chrome 自动完成(在页面加载或对话框中填充表单)
所以我添加了这段代码:
#{$all-text-inputs} {
&:-webkit-autofill + #{$this}-placeholder {
left: 0;
right: 0 ;
transform: translateY(-34px);
@include text(big, $lh: 1.3em, $fw: fw(regular));
opacity: 1;
}
}
这在 Chrome 桌面中按预期工作:-webkit-autofill 触发并占位符转到顶部
但似乎这个伪类在 Chrome Mobile (IOS) 中不起作用
输入结构:
<div class="input input-with-float-placeholder">
<div class="input-inner">
<input type="email">
<span class="input-placeholder">Username</span>
</div>
</div>
【问题讨论】:
标签: html ios css google-chrome autofill