选项卡Tab

选项卡 Tab - 图1

  1. <div class="tab">
  2. <ul class="nav">
  3. <li>Clothing</li>
  4. <li>Accessories</li>
  5. <li>Electronics</li>
  6. </ul>
  7. <ul class="content">
  8. <li>
  9. <p>Content A</p>
  10. </li>
  11. <li>
  12. <p>Content B</p>
  13. </li>
  14. <li>
  15. <p>Content C</p>
  16. </li>
  17. </ul>
  18. </div>

填充Grow

添加class="grow"使导航项自动均分剩余空间

选项卡 Tab - 图2

  1. <div class="tab grow">
  2. ...
  3. </div>

垂直排列Vertical

添加class="left"转换为垂直左侧排列,添加class="right"转换为垂直右侧排列

选项卡 Tab - 图3

选项卡 Tab - 图4

  1. Left:
  2. <div class="tab left">
  3. ...
  4. </div>
  5. Right:
  6. <div class="tab right">
  7. ...
  8. </div>

激活与禁用Active and Disabled

为导航项<li>元素添加class="active"使其默认是显示的,添加class="disabled"转换为禁用项

选项卡 Tab - 图5

  1. <div class="tab">
  2. <ul class="nav">
  3. <li>Clothing</li>
  4. <li class="active">Accessories</li>
  5. <li class="disabled">Electronics</li>
  6. </ul>
  7. <ul class="content">
  8. <li>
  9. <p>Content A</p>
  10. </li>
  11. <li>
  12. <p>Content B</p>
  13. </li>
  14. <li>
  15. <p>Content C</p>
  16. </li>
  17. </ul>
  18. </div>

移动选项Move Item

在内容项中添加data-move-item属性的元素会触发移动至设定项

选项卡 Tab - 图6

  1. <div class="tab">
  2. <ul class="nav">
  3. <li>Clothing</li>
  4. <li>Accessories</li>
  5. <li>Electronics</li>
  6. </ul>
  7. <ul class="content">
  8. <li>
  9. <p>Content A</p>
  10. <button type="button" class="btn xs" data-move-item="first">First</button>
  11. <button type="button" class="btn xs" data-move-item="prev">Prev</button>
  12. <button type="button" class="btn xs" data-move-item="next">Next</button>
  13. <button type="button" class="btn xs" data-move-item="last">Last</button>
  14. </li>
  15. <li>
  16. <p>Content B</p>
  17. <button type="button" class="btn xs" data-move-item="first">First</button>
  18. <button type="button" class="btn xs" data-move-item="prev">Prev</button>
  19. <button type="button" class="btn xs" data-move-item="next">Next</button>
  20. <button type="button" class="btn xs" data-move-item="last">Last</button>
  21. </li>
  22. <li>
  23. <p>Content C</p>
  24. <button type="button" class="btn xs" data-move-item="first">First</button>
  25. <button type="button" class="btn xs" data-move-item="prev">Prev</button>
  26. <button type="button" class="btn xs" data-move-item="next">Next</button>
  27. <button type="button" class="btn xs" data-move-item="last">Last</button>
  28. </li>
  29. </ul>
  30. </div>

自定义风格Custom Style

可以使用自定义风格工具快速创建CSS

选项卡 Tab - 图7

选项卡 Tab - 图8

  1. <div class="tab mystyle">
  2. ...
  3. </div>
  4. <div class="tab left mystyle">
  5. ...
  6. </div>