使用CSS重置样式输入类型

Style input type reset with CSS

输入类型按钮可以是提交按钮或重置按钮。 使用CSS,我们可以设置网页上任何按钮的样式。

您可以尝试运行以下代码来设置输入类型按钮的样式:

现场演示

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!DOCTYPE html>
<html>
 <head>
   <style>
    input[type = submit], input[type = reset] {
      background-color: orange;
      border: none;
      text-decoration: none;
      color: white;
      padding: 20px 20px;
      margin: 20px 20px;
      cursor: pointer;
    }
   </style>
 </head>
 <body>
   <p><center>[wp_ad_camp_2]</center></p><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">
    <input type ="reset" value ="Reset">
    <input type ="submit" value ="Submit">
   </form>
 </body>
</html>