使用 CSS 設定有邊框的表單輸入
若要為表單輸入設定邊框,請使用 CSS border 屬性。
您可以嘗試執行以下程式碼來新增邊框
示例
<!DOCTYPE html> <html> <head> <style> input[type = text] { width: 100%; padding: 10px 15px; margin: 5px 0; box-sizing: border-box; border: 3px inset orange; } </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>
廣告