源代码:
下载代码
AI 编程工具
点击运行
<!DOCTYPE html> <html> <head> <title>Bootstrap5 实例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://cdn.staticfile.net/twitter-bootstrap/5.1.1/css/bootstrap.min.css" rel="stylesheet"> <script src="https://cdn.staticfile.net/twitter-bootstrap/5.1.1/js/bootstrap.bundle.min.js"></script> </head> <body> <div class="container mt-3"> <h2>选择区间</h2> <p>要设置一个选择区间可以在 input 元素中添加 type="range" 并使用 .form-range 类:</p> <form action="/action_page.php"> <label for="customRange" class="form-label">自定义选择区间</label> <input type="range" class="form-range" id="customRange" name="points"> <label for="customRange" class="form-label">默认选择区间</label> <input type="range" id="defaultRange" name="points"><br> <button type="submit" class="btn btn-primary mt-3">Submit</button> </form> </div> </body> </html>
运行结果: