【发布时间】:2015-10-25 21:49:29
【问题描述】:
我的理解是 Materialize 不支持样式化的多选框 - 您必须指定浏览器默认值并且不使用 Materialize 样式。 (如果我错了,请纠正我)
因此,我尝试使用 Materialize 下拉菜单与下拉列表中的复选框进行等效,如下所示:
<a class='dropdown-button btn-flat' href='#' data-activates='topics_dropdown' data-hover="true">
Relates to topics...</a>
<ul id='topics_dropdown' class='dropdown-content'>
<li>
<input type="checkbox" name="report[topics][409928004]" id="report_topics_409928004" value="1" />
<label for="report_topics_409928004">Engagement</label>
</li>
<li>
<input type="checkbox" name="report[topics][669658064]" id="report_topics_669658064" value="1" />
<label for="report_topics_669658064">Appraisal</label>
</li>
<!-- etc. -->
</ul>
但是渲染的方式有一个小故障。文本和框向下偏移半线,因此突出显示悬停效果突出显示重叠两个不同选项的矩形。有没有办法纠正这个故障?
这是一个屏幕截图。它与上面的示例代码的内容不同,但它是相同的下拉复选框结构。
【问题讨论】:
-
找个小提琴搭档 :)
标签: css dropdownbox materialize