Foundation 教程
1. Foundation 教程 2. Foundation 起步 3. Foundation 文本 4. Foundation 表格 5. Foundation 按钮 6. Foundation 按钮组 7. Foundation 图标 8. Foundation 标签 9. Foundation 提醒框 10. Foundation 进度条 11. Foundation 面板 12. Foundation 图片 13. Foundation 下拉菜单 14. Foundation 折叠列表 15. Foundation 列表 16. Foundation 选项卡 17. Foundation 分页 18. Foundation 价格表 19. Foundation 顶部导航栏 20. Foundation 侧边栏 21. Foundation 滑动导航(Off-Canvas) 22. Foundation 麦哲伦(Magellan)导航 23. Foundation 表单 24. Foundation 输入框尺寸 25. Foundation 开关 26. Foundation 滑块 27. Foundation 提示框 28. Foundation 模态框 29. Foundation Joyride 30. Foundation 均衡器(Equalizer) 31. Foundation 网格系统 32. Foundation 网格 – 水平堆叠 33. Foundation 网格 – 小型设备 34. Foundation 网格 – 中型设备 35. Foundation 网格 – 大型设备 36. Foundation 块状网格 37. Foundation 网格实例 38. Foundation 图标参考手册 39. Foundation CSS 参考手册 40. Foundation CSS 可见性

Foundation 开关

Foundation 开关

开关是在鼠标点击(手指敲击)下在 "On" 和 "Off" 状态下切换:

切换开关使用 <div class="switch"> 创建。 <div> 内添加带有唯一 id 的 <input type="checkbox"><label> 元素的 for 属性需要与 <input type="checkbox"> 的 id 相匹配:

实例

<div class="switch">
  <input id="mySwitch" type="checkbox">
  <label for="mySwitch"></label>
</div>

55面试教程网 »

开关大小

使用 .large, .small.tiny 类来设置开关大小:

实例

<div class="switch large">...</div>
<div class="switch">...</div>
<div class="switch small">...</div>
<div class="switch tiny">...</div>

55面试教程网 »

圆角切换开关

使用 .radius.round 类来设置圆角切换开关:

实例

<div class="switch">...</div>
<div class="switch radius">...</div>
<div class="switch round">...</div>

55面试教程网 »

开关组

可以通过设置单选按钮(radio)来设置单个选项。注意: 注意各个选项的 name 属性必须一致 (实例中为 "myGroup" )。

实例

<div class="switch">
  <input id="mySwitch1" type="radio" name="myGroup">
  <label for="mySwitch1"></label>
</div>

<div class="switch">
  <input id="mySwitch2" type="radio" name="myGroup" checked>
  <label for="mySwitch2"></label>
</div>

55面试教程网 »