CSS中的角色:in-range選擇器
使用 CSS :in-range 選擇器來設定 <input> 元素的樣式,其中元素值位於指定範圍內。你可以嘗試執行以下程式碼來實現 :in-range 選擇器 -
示例
<!DOCTYPE html>
<html>
<head>
<style>
input:in-range {
border: 3px dashed orange;
background: yellow;
}
</style>
</head>
<body>
<input type = "number" min = "5" max = "10" value = "9">
<p>The style only works for the value entered i.e. 9</p>
</body>
</html>
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP