我想使用materialize css class dropdown-content进行子下拉列表。但是下面的代码不起作用:
<a class='dropdown-button btn' href='#' data-activates='dropdown1' data-beloworigin="true">Drop1!</a>
<ul id='dropdown1' class='dropdown-content'>
<li><a href="#!">item1</a></li>
<li><a href="#!">item2</a></li>
<li id="drop2" ><a class='dropdown-button2 d' href='#' data-hover="hover" data-alignment="left">dropagain</a></li>
</ul>
<ul id="drop2" class='dropdown-content'>
<li><a href="#!">Item3</a></li>
<li><a href="#!">Item4</a></li>
</ul>
答案 0 :(得分:0)
.dropdown-content {
overflow-y: visible;
}
.dropdown-content .dropdown-content {
margin-left: 100%;
}
<a class='dropdown-button btn' href='#' data-activates='dropdown1' data-beloworigin="true">Drop1!</a>
<ul id='dropdown1' class='dropdown-content'>
<li><a href="#!">item1</a></li>
<li><a href="#!">item2</a></li>
<li id="drop2" ><a class='dropdown-button2 d' href='#' data-hover="hover" data-alignment="left">dropagain</a></li>
</ul>
<ul id="drop2" class='dropdown-content'>
<li><a href="#!">Item3</a></li>
<li><a href="#!">Item4</a></li>
</ul>