当前位置:Gxlcms > JavaScript > Bootstrap CSS布局之列表

Bootstrap CSS布局之列表

时间:2021-07-01 10:21:17 帮助过:36人阅读

本文实例为大家分享了Bootstrap CSS布局中的列表布局,供大家参考,具体内容如下

列表
普通列表ul li
有序列表ol li
去点列表.list-unstyled
内联列表.list-inline
定义列表dl dt dd
水平定义列表dl-horizontal

  1. ul,
  2. ol {
  3. margin-top: 0;
  4. margin-bottom: 10px;
  5. }
  6. ul ul,
  7. ol ul,
  8. ul ol,
  9. ol ol {
  10. margin-bottom: 0;
  11. }

普通列表ul li
有序列表ol li
去点列表class=”list-unstyled”

  1. //源码
  2. .list-unstyled {
  3. padding-left: 0;
  4. list-style: none;
  5. }

内联列表class=”list-inline”

  1. //源码
  2. .list-inline {
  3. padding-left: 0;
  4. margin-left: -5px;
  5. list-style: none;
  6. }
  7. .list-inline > li {
  8. display: inline-block;
  9. padding-right: 5px;
  10. padding-left: 5px;
  11. }

定义列表dl dt dd

  1. dl {
  2. margin-top: 0;
  3. margin-bottom: 20px;
  4. }
  5. dt,
  6. dd {
  7. line-height: 1.42857143;
  8. }
  9. dt {
  10. font-weight: bold;
  11. }
  12. dd {
  13. margin-left: 0;
  14. }

水平定义列表class=”dl-horizontal”

  1. @media (min-width: 768px) {
  2. .dl-horizontal dt {
  3. float: left;
  4. width: 160px;
  5. overflow: hidden;
  6. clear: left;
  7. text-align: right;
  8. //显示省略符号来代表被修剪的文本
  9. text-overflow: ellipsis;
  10. white-space: nowrap;
  11. }
  12. .dl-horizontal dd {
  13. margin-left: 180px;
  14. }
  15. }

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。

人气教程排行