樣式使用 CSS 調整超出指定範圍的值的元素
使用 CSS :out-of-range 選擇器調整超出指定範圍的值的 <input> 元素的樣式。
示例
可以嘗試執行以下程式碼來實現 :out-of-range 選擇器
<!DOCTYPE html>
<html>
<head>
<style>
input:out-of-range {
border: 3px dashed orange;
background: yellow;
}
</style>
</head>
<body>
<input type = "number" min = "5" max = "10" value = "15">
<p>The style only works for the value entered out of range</p>
</body>
</html>
廣告
資料結構
網路
關係型資料庫管理系統
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP