Bootstrap 5: Range


فهرست مطالب

    نمایش فهرست مطالب

ﯽﺷﺭﺎﻔﺳ ﻩﺩﻭﺪﺤﻣ

:ﺪﯿﻨﮐ ﻪﻓﺎﺿﺍ "type="range ﺎﺑ ﯼﺩﻭﺭﻭ ﺮﺼﻨﻋ ﻪﺑ ﺍﺭ .form-r



ﻝﺎﺜﻣ

<label for="customRange" class="form-label">Custom range</label>
<input type="range" class="form-range" id="customRange">

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>

<div class="container mt-3">
  <h2>Custom Range</h2>
  <p>To create a custom range menu, add the .form-range class to the input element with type="range":</p>
  <form action="/action_page.php">
    <label for="customRange" class="form-label">Custom range</label>
    <input type="range" class="form-range" id="customRange" name="points">
    
    <button type="submit" class="btn btn-primary mt-3">Submit</button>
  </form>
</div>

</body>
</html>

ﻞﺣﺍﺮﻣ

:ﺪﯿﻫﺩ ﺮﯿﯿﻐﺗ ﺍﺭ ﻥﺁ step ﯽﮔﮋﯾﻭ ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺎﺑ ﺪﯿ

ﻝﺎﺜﻣ

<input type="range" class="form-range" step="10">

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>

<div class="container mt-3">
  <h2>Steps in a Range</h2>
  <p>By default, the interval between the range numbers is 1. You can change it by using the step attribute:</p>
  <form action="/action_page.php">
    <label for="customRange" class="form-label">Custom range</label>
    <input type="range" class="form-range" id="customRange" step="10" name="points">
    
    <button type="submit" class="btn btn-primary mt-3">Submit</button>
  </form>
</div>

</body>
</html>

ﺮﺜﮐﺍﺪﺣ ﻭ ﻞﻗﺍﺪﺣ

:ﺪﯿﻫﺩ ﺮﯿﯿﻐﺗ ﺍﺭ ﻥﺁ ﯽﮔﮋﯾﻭ < .ﺪﯿﻨﮐ ﻩﺩﺎﻔﺘﺳﺍ code/>ﺮﺜﮐﺍﺪﺣ<"code class="w3-codespan>

ﻝﺎﺜﻣ

<input type="range" class="form-range" min="0" max="4">

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>

<div class="container mt-3">
  <h2>Min and Max Range</h2>
  <p>Use the min and/or max attribute to specify the minimum/maximum value of a range:</p>
  <form action="/action_page.php">
    <label for="customRange" class="form-label">Custom range</label>
    <input type="range" class="form-range" id="customRange" name="points" min="0" max="4">
    
    <button type="submit" class="btn btn-primary mt-3">Submit</button>
  </form>
</div>

</body>
</html>