Computer >> Máy Tính >  >> Lập trình >> CSS

Trường nhập kiểu của biểu mẫu với CSS


Để tạo kiểu cho trường đầu vào của biểu mẫu, bạn có thể thử chạy mã sau. Tạo kiểu cho < input >:

Ví dụ

<!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>