Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> CSS

Tạo kiểu cho các trường input của form với CSS

Để tạo kiểu cho trường input của form, bạn có thể chạy mã sau. Tạo kiểu cho thẻ <input>:

Ví dụ

<!DOCTYPE html>
<html>
  <head>
    <style>
      input {
        width: 100%;
      }
    </style>
  </head>
  <body>
    <p>Điền form bên dưới,</p>
    <form>
      <label for="subject">Môn học</label>
      <input type="text" id="subject" name="sub">
      <label for="student">Học sinh</label>
      <input type="text" id="student" name="stu">
    </form>
  </body>
</html>