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

Tạo kiểu cho input type submit với CSS

Loại nút input có thể là nút submit hoặc reset. Với CSS, chúng ta có thể tạo kiểu cho bất kỳ nút nào trên trang web.

Ví dụ

Bạn có thể chạy mã sau để tạo kiểu cho input type submit:

<!DOCTYPE html>
<html>
  <head>
    <style>
      input[type="submit"] {
        background-color: orange;
        border: none;
        text-decoration: none;
        color: white;
        padding: 20px 20px;
        margin: 20px 20px;
        cursor: pointer;
      }
    </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"><br><br>
      <label for="student">Học sinh</label>
      <input type="text" id="student" name="stu"><br>
      <input type="submit" value="Gửi">
    </form>
  </body>
</html>