使用CSS向表单输入添加背景色
要将背景色添加到表单输入中,请使用 background-color属性。
您可以尝试运行以下代码以实现背景颜色属性以形成
示例
<!DOCTYPE html>
<html>
<head>
<style>
input[type=text] {
width: 100%;
padding: 10px 15px;
margin: 5px 0;
box-sizing: border-box;
background-color: gray;
}
</style>
</head>
<body>
<p>Fill the below form,</p>
<form>
<label for = "subject">Subject</label>
<input type = "text" id = "subject" name = "sub">
<label for = "student">Student</label>
<input type = "text" id = "student" name = "stu">
</form>
</body>
</html>热门推荐
10 高一祝福语简短 励志
11 立秋节气简短祝福语
12 简短公司周年祝福语大全
13 中考感言简短祝福语大全
14 体育老师简短祝福语
15 干杯生日祝福语简短独特
16 特别简短的祝福语老师
17 朋友坐车走了祝福语简短
18 给英雄的祝福语简短