使用 CSS 设置表单输入字段的样式

cssweb developmentfront end technology更新于 2024/7/10 23:08:17

要设置表单输入字段的样式,您可以尝试运行以下代码。设置 <input> 的样式:

示例

<!DOCTYPE html>
<html>
   <head>
      <style>
         input {
            width: 100%;
         }
      </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>

相关文章


有用资源