Bootstrap系列 -- 28. 下拉選單狀態

賀臣發表於2015-06-25

 

  下拉選單項的預設的狀態(不用設定)有懸浮狀態(:hover)和焦點狀態(:focus)。

  下拉選單項除了上面兩種狀態,還有當前狀態(.active)和禁用狀態(.disabled)。這兩種狀態使用方法只需要在對應的選單項上新增對應的類名

<div class="dropdown">
  <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown">
    下拉選單
    <span class="caret"></span>
  </button>
  <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
    <li role="presentation" class="active"><a role="menuitem" tabindex="-1" href="#">下拉選單項</a></li>
    <li role="presentation"><a role="menuitem" tabindex="-1" href="#">下拉選單項</a></li>
    <li role="presentation"><a role="menuitem" tabindex="-1" href="#">下拉選單項</a></li>
    <li role="presentation" class="divider"></li>
    <li role="presentation" class="disabled"><a role="menuitem" tabindex="-1" href="#">下拉選單項</a></li>
  </ul>
</div> 

 

相關文章