源代码:
下载代码
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>默认情况下,步长为 1,可以通过 step 属性来设置:</p> <form action="/action_page.php"> <label for="customRange" class="form-label">自定义步长</label> <input type="range" class="form-range" step="10"> <button type="submit" class="btn btn-primary mt-3">Submit</button> </form> </div> </body> </html>
运行结果: