自己写的banner图上的表单例子,为什么字体颜色设置没有效果
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
.banner{
margin: 0 auto;
background-color: burlywood;
width: 800px;
height: 500px;
display: flex;
justify-content: center;
align-items: center;
}
input{
width: 500px;
padding: 12px 20px;
margin: 8px 0;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
background-color: rgba(255,255,255,0);
}
</style>
</head>
<body>
<div class="banner">
<form>
<input type="text" name="name" placeholder="your name"/>
<br />
<input type="tel" name="phone" placeholder="your phone" />
</form>
</div>
</body>
</html>
老师 看下这样写对不对?
正在回答
你好,如果在input框中设置字体颜色属性,之后当输入的时候字体颜色才是白色的:

如果想要placeholder属性中内容字体为白色,可以添加样式:


自己可以测试下,祝学习愉快!
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星