如何在 MaterializeCSS 中将标签与 select 对齐?

How to align label with select in MaterializeCSS?

我正在尝试使用 MaterializeCSS 创建多个 select
我的 html 看起来像这样:

<div class="input-field">
    <select multiple>
        <option value="" disabled selected>Choose your option</option>
        <option value="1">Option 1</option>
        <option value="2">Option 2</option>
        <option value="3">Option 3</option>
    </select>
    <label>Brands</label>
</div>    

激活select:$('select').material_select();

不幸的是结果是这样的:

虽然他们的示例看起来像 this

怎么会?

我也有这个问题。

确保你的 input-field 包含在 div 和 class row 中,并确保你的 input-field 有一个 col 和大小 class:

<div class="row">
    <div class="input-field col s12">
    ...

如果这不起作用,请确保 form 或其他 div 的其他 class 与 materialise 网站上的示例匹配。