title: Bootstrap offcanvas height to content
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.cursor-pointer {
    cursor: pointer;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/js/bootstrap.bundle.min.js"&gt;&lt;/script&gt;
  &lt;link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/css/bootstrap.min.css" rel="stylesheet"/&gt;
  &lt;link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.1/font/bootstrap-icons.css" rel="stylesheet"/&gt;
  &lt;button class="btn btn-primary m-2" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasBottom" aria-controls="offcanvasBottom"&gt;Toggle bottom offcanvas&lt;/button&gt;
  &lt;div class="offcanvas offcanvas-bottom" tabindex="-1" id="offcanvasBottom" aria-labelledby="offcanvasBottomLabel"&gt;
    &lt;div class="offcanvas-body p-0 h-50"&gt;
      &lt;ul class="list-unstyled m-0 fs-5"&gt;
        &lt;li class="bg-danger text-light px-3 py-2"&gt;
          &lt;i class="bi bi-trash"&gt;&lt;/i&gt;
          Delete
        &lt;/li&gt;
        &lt;li class="bg-primary text-light px-3 py-2"&gt;
          &lt;i class="bi bi-pin"&gt;&lt;/i&gt;
          Pin
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>How can I fit a height to content in my code?
  I tried <code>d-inline</code> and <code>h-50</code> but nothing is working. any help?</p>