这里有问题吗
来源:2-8 编程练习
unbreakable_全栈
2020-10-03 09:40:59
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
input:-webkit-autofill {
box-shadow: 0 0 0 100px #fff inset;
}
</style>
</head>
<body>
<!-- 方法一:autocomplete设置表单属性; -->
<!-- <form action="" method="post" autocomplete="off">
<input type="text" name="user">
<input type="text" name="password">
<input type="submit">
</form> -->
<!-- 方法二:-webkit-autofill控制css样式 -->
<form action="" method="post">
<input type="text" name="user">
<input type="text" name="password">
<input type="submit">
</form>
<!-- TODO 方法二有下拉框,方法一没有下拉框吗 -->
</body>
</html>
1回答
同学你好,代码实现正确。另外,同学注释的问题解答如下:
没错,第一个方法没有下拉菜单。因为autocomplete属性是设置自动完成功能的,也就是下拉菜单提示。第一个方法通过autocomplete="off"关闭了提示,所以没有下拉菜单提示了。
如果我的回答帮助到了你,欢迎采纳,祝学习愉快~
相似问题