Dmitry Bubnenkov
Dmitry Bubnenkov

Reputation: 9859

How to increase size of dropdown menu?

I am using beercss and alpinejs I need did dropdown menu, but it's width is smaller than it's context. enter image description here

<nav class="wrap">
  <div class="tabs right-align">
    <a>Tab 1</a>
    <a>Tab 2</a>
    <a>Tab 3</a>
    <a x-data="{ active: false }">
      <button @click="active = !active">
        <span>Login</span>
        <div x-show="active" class="dropdown">
          <a>
            <label>Complementary text</label>
          </a>
        </div>

      </button>
    </a>

  </div>

</nav>

How to fix it?

https://codepen.io/bubnenkoff/pen/VwMmEgb

Upvotes: 0

Views: 606

Answers (1)

bhdzllr
bhdzllr

Reputation: 123

Because your button is on the right, the dropdown disappears outside of the visible area. According to the docs you can use the class list "dropdown left no-wrap" to position the dropdown ("left") and have the width based on the content ("no-wrap").

Upvotes: 3

Related Questions