使用 CSS 設定 `

輸入型別按鈕可以是提交按鈕或重置按鈕。使用 CSS,我們可以對網頁上的任何按鈕設定樣式。

可以嘗試執行以下程式碼為輸入型別按鈕設定樣式

示例

線上演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         input[type=button] {
            background-color: orange;
            border: none;
            text-decoration: none;
            color: white;
            padding: 20px 20px;
            margin: 20px 20px;
            cursor: pointer;
         }
      </style>
   </head>
   <body>
      <p>Fill the below form,</p>
      <form>
         <label for = "subject">Subject</label>
         <input type = "text" id = "subject" name = "sub"><br><br>
         <label for = "student">Student</label>
         <input type = "text" id = "student" name = "stu"><br>
         <input type = "button" value = "Button">
      </form>
   </body>
</html>

更新時間: 2020 年 6 月 24 日

4K+ 瀏覽量

開啟職業生涯 之路

完成課程並獲取認證

開始學習
廣告
© . All rights reserved.