grid_options.html 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>H+ 后台主题UI框架 - 栅格</title>
  7. <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
  8. <meta name="description" content="H+是一个完全响应式,基于Bootstrap3最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术">
  9. <link rel="shortcut icon" href="favicon.ico"> <link href="css/bootstrap.min.css?v=3.3.7" rel="stylesheet">
  10. <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">
  11. <link href="css/plugins/iCheck/custom.css" rel="stylesheet">
  12. <link href="css/animate.css" rel="stylesheet">
  13. <link href="css/style.css?v=4.1.0" rel="stylesheet">
  14. </head>
  15. <body class="gray-bg">
  16. <div class="wrapper wrapper-content">
  17. <div class="row">
  18. <div class="col-sm-12">
  19. <div class="ibox float-e-margins">
  20. <div class="ibox-title">
  21. <h5>栅格设置</h5>
  22. <div class="ibox-tools">
  23. <a class="collapse-link">
  24. <i class="fa fa-chevron-up"></i>
  25. </a>
  26. <a class="dropdown-toggle" data-toggle="dropdown" href="grid_options.html#">
  27. <i class="fa fa-wrench"></i>
  28. </a>
  29. <ul class="dropdown-menu dropdown-user">
  30. <li><a href="grid_options.html#">选项1</a>
  31. </li>
  32. <li><a href="grid_options.html#">选项2</a>
  33. </li>
  34. </ul>
  35. <a class="close-link">
  36. <i class="fa fa-times"></i>
  37. </a>
  38. </div>
  39. </div>
  40. <div class="ibox-content">
  41. <p>通过下表可以详细查看 Bootstrap 的栅格系统是如何在多种屏幕设备上工作的。</p>
  42. <div class="table-responsive">
  43. <table class="table table-bordered table-striped">
  44. <thead>
  45. <tr>
  46. <th></th>
  47. <th>
  48. 超小屏幕
  49. <small>手机 (&lt;768px)</small>
  50. </th>
  51. <th>
  52. 小屏幕
  53. <small>平板 (≥768px)</small>
  54. </th>
  55. <th>
  56. 中等屏幕
  57. <small>桌面显示器 (≥992px)</small>
  58. </th>
  59. <th>
  60. 大屏幕
  61. <small>大桌面显示器 (≥1200px)</small>
  62. </th>
  63. </tr>
  64. </thead>
  65. <tbody>
  66. <tr>
  67. <th class="text-nowrap">栅格系统行为</th>
  68. <td>总是水平排列</td>
  69. <td colspan="3">开始是堆叠在一起的,当大于这些阈值时将变为水平排列C</td>
  70. </tr>
  71. <tr>
  72. <th class="text-nowrap"><code>.container</code> 最大宽度</th>
  73. <td>None (自动)</td>
  74. <td>750px</td>
  75. <td>970px</td>
  76. <td>1170px</td>
  77. </tr>
  78. <tr>
  79. <th class="text-nowrap">类前缀</th>
  80. <td><code>.col-xs-</code>
  81. </td>
  82. <td><code>.col-sm-</code>
  83. </td>
  84. <td><code>.col-md-</code>
  85. </td>
  86. <td><code>.col-lg-</code>
  87. </td>
  88. </tr>
  89. <tr>
  90. <th class="text-nowrap">列(column)数</th>
  91. <td colspan="4">12</td>
  92. </tr>
  93. <tr>
  94. <th class="text-nowrap">最大列(column)宽</th>
  95. <td class="text-muted">自动</td>
  96. <td>~62px</td>
  97. <td>~81px</td>
  98. <td>~97px</td>
  99. </tr>
  100. <tr>
  101. <th class="text-nowrap">槽(gutter)宽</th>
  102. <td colspan="4">30px (每列左右均有 15px)</td>
  103. </tr>
  104. <tr>
  105. <th class="text-nowrap">可嵌套</th>
  106. <td colspan="4">是</td>
  107. </tr>
  108. <tr>
  109. <th class="text-nowrap">偏移(Offsets)</th>
  110. <td colspan="4">是</td>
  111. </tr>
  112. <tr>
  113. <th class="text-nowrap">列排序</th>
  114. <td colspan="4">是</td>
  115. </tr>
  116. </tbody>
  117. </table>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. <div class="row">
  124. <div class="col-sm-12">
  125. <div class="ibox float-e-margins">
  126. <div class="ibox-title">
  127. <h5>从堆叠到水平排列</h5>
  128. <div class="ibox-tools">
  129. <a class="collapse-link">
  130. <i class="fa fa-chevron-up"></i>
  131. </a>
  132. <a class="dropdown-toggle" data-toggle="dropdown" href="grid_options.html#">
  133. <i class="fa fa-wrench"></i>
  134. </a>
  135. <ul class="dropdown-menu dropdown-user">
  136. <li><a href="grid_options.html#">选项1</a>
  137. </li>
  138. <li><a href="grid_options.html#">选项2</a>
  139. </li>
  140. </ul>
  141. <a class="close-link">
  142. <i class="fa fa-times"></i>
  143. </a>
  144. </div>
  145. </div>
  146. <div class="ibox-content">
  147. <p>使用单一的一组 <code>.col-md-*</code> 栅格类,就可以创建一个基本的栅格系统,在手机和平板设备上一开始是堆叠在一起的(超小屏幕到小屏幕这一范围),在桌面(中等)屏幕设备上变为水平排列。所有“列(column)必须放在 ” <code>.row</code> 内。</p>
  148. <div class="row show-grid">
  149. <div class="col-md-1">.col-md-1</div>
  150. <div class="col-md-1">.col-md-1</div>
  151. <div class="col-md-1">.col-md-1</div>
  152. <div class="col-md-1">.col-md-1</div>
  153. <div class="col-md-1">.col-md-1</div>
  154. <div class="col-md-1">.col-md-1</div>
  155. <div class="col-md-1">.col-md-1</div>
  156. <div class="col-md-1">.col-md-1</div>
  157. <div class="col-md-1">.col-md-1</div>
  158. <div class="col-md-1">.col-md-1</div>
  159. <div class="col-md-1">.col-md-1</div>
  160. <div class="col-md-1">.col-md-1</div>
  161. </div>
  162. <div class="row show-grid">
  163. <div class="col-md-8">.col-md-8</div>
  164. <div class="col-md-4">.col-md-4</div>
  165. </div>
  166. <div class="row show-grid">
  167. <div class="col-md-4">.col-md-4</div>
  168. <div class="col-md-4">.col-md-4</div>
  169. <div class="col-md-4">.col-md-4</div>
  170. </div>
  171. <div class="row show-grid">
  172. <div class="col-md-6">.col-md-6</div>
  173. <div class="col-md-6">.col-md-6</div>
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. </div>
  179. <div class="row">
  180. <div class="col-sm-12">
  181. <div class="ibox float-e-margins">
  182. <div class="ibox-title">
  183. <h5>移动设备和桌面屏幕</h5>
  184. <div class="ibox-tools">
  185. <a class="collapse-link">
  186. <i class="fa fa-chevron-up"></i>
  187. </a>
  188. <a class="dropdown-toggle" data-toggle="dropdown" href="grid_options.html#">
  189. <i class="fa fa-wrench"></i>
  190. </a>
  191. <ul class="dropdown-menu dropdown-user">
  192. <li><a href="grid_options.html#">选项1</a>
  193. </li>
  194. <li><a href="grid_options.html#">选项2</a>
  195. </li>
  196. </ul>
  197. <a class="close-link">
  198. <i class="fa fa-times"></i>
  199. </a>
  200. </div>
  201. </div>
  202. <div class="ibox-content">
  203. <p>是否不希望在小屏幕设备上所有列都堆叠在一起?那就使用针对超小屏幕和中等屏幕设备所定义的类吧,即 <code>.col-xs-*</code> 和 <code>.col-md-*</code>。请看下面的实例,研究一下这些是如何工作的。</p>
  204. <div class="row show-grid">
  205. <div class="col-xs-12 col-md-8">.col-xs-12 .col-md-8</div>
  206. <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
  207. </div>
  208. <div class="row show-grid">
  209. <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
  210. <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
  211. <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
  212. </div>
  213. <div class="row show-grid">
  214. <div class="col-xs-6">.col-xs-6</div>
  215. <div class="col-xs-6">.col-xs-6</div>
  216. </div>
  217. </div>
  218. </div>
  219. </div>
  220. </div>
  221. <div class="row">
  222. <div class="col-sm-12">
  223. <div class="ibox float-e-margins">
  224. <div class="ibox-title">
  225. <h5>手机、平板、桌面</h5>
  226. <div class="ibox-tools">
  227. <a class="collapse-link">
  228. <i class="fa fa-chevron-up"></i>
  229. </a>
  230. <a class="dropdown-toggle" data-toggle="dropdown" href="grid_options.html#">
  231. <i class="fa fa-wrench"></i>
  232. </a>
  233. <ul class="dropdown-menu dropdown-user">
  234. <li><a href="grid_options.html#">选项1</a>
  235. </li>
  236. <li><a href="grid_options.html#">选项2</a>
  237. </li>
  238. </ul>
  239. <a class="close-link">
  240. <i class="fa fa-times"></i>
  241. </a>
  242. </div>
  243. </div>
  244. <div class="ibox-content">
  245. <p>在上面案例的基础上,通过使用针对平板设备的 <code>.col-sm-*</code> 类,我们来创建更加动态和强大的布局吧。</p>
  246. <div class="row show-grid">
  247. <div class="col-xs-12 col-sm-6 col-md-8">.col-xs-12 .col-sm-6 .col-md-8</div>
  248. <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
  249. </div>
  250. <div class="row show-grid">
  251. <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
  252. <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
  253. <!-- Optional: clear the XS cols if their content doesn't match in height -->
  254. <div class="clearfix visible-xs"></div>
  255. <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
  256. </div>
  257. </div>
  258. </div>
  259. </div>
  260. </div>
  261. <div class="row">
  262. <div class="col-sm-12">
  263. <div class="ibox float-e-margins">
  264. <div class="ibox-title">
  265. <h5>多余的列(column)将另起一行排列</h5>
  266. <div class="ibox-tools">
  267. <a class="collapse-link">
  268. <i class="fa fa-chevron-up"></i>
  269. </a>
  270. <a class="dropdown-toggle" data-toggle="dropdown" href="grid_options.html#">
  271. <i class="fa fa-wrench"></i>
  272. </a>
  273. <ul class="dropdown-menu dropdown-user">
  274. <li><a href="grid_options.html#">选项1</a>
  275. </li>
  276. <li><a href="grid_options.html#">选项2</a>
  277. </li>
  278. </ul>
  279. <a class="close-link">
  280. <i class="fa fa-times"></i>
  281. </a>
  282. </div>
  283. </div>
  284. <div class="ibox-content">
  285. <p>在等宽的4网格中,网格不等高会碰到问题,为了解决这个问题,可使用<code>.clearfix</code>。<a href="grid_options.html#responsive-utilities">响应实用工具类</a>
  286. </p>
  287. <div class="row show-grid">
  288. <div class="col-xs-6 col-sm-3">
  289. .col-xs-6 .col-sm-3
  290. <br>调整窗口大小或者在手机上查看本示例
  291. </div>
  292. <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
  293. <!-- Add the extra clearfix for only the required viewport -->
  294. <div class="clearfix visible-xs"></div>
  295. <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
  296. <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
  297. </div>
  298. </div>
  299. </div>
  300. </div>
  301. </div>
  302. <div class="row">
  303. <div class="col-sm-12">
  304. <div class="ibox float-e-margins">
  305. <div class="ibox-title">
  306. <h5>列偏移</h5>
  307. <div class="ibox-tools">
  308. <a class="collapse-link">
  309. <i class="fa fa-chevron-up"></i>
  310. </a>
  311. <a class="dropdown-toggle" data-toggle="dropdown" href="grid_options.html#">
  312. <i class="fa fa-wrench"></i>
  313. </a>
  314. <ul class="dropdown-menu dropdown-user">
  315. <li><a href="grid_options.html#">选项1</a>
  316. </li>
  317. <li><a href="grid_options.html#">选项2</a>
  318. </li>
  319. </ul>
  320. <a class="close-link">
  321. <i class="fa fa-times"></i>
  322. </a>
  323. </div>
  324. </div>
  325. <div class="ibox-content">
  326. <p>使用 <code>.col-md-offset-*</code> 类可以将列向右侧偏移。这些类实际是通过使用 <code>*</code> 选择器为当前元素增加了左侧的边距(margin)。例如,<code>.col-md-offset-4</code> 类将 <code>.col-md-4</code> 元素向右侧偏移了4个列(column)的宽度。</p>
  327. <div class="row show-grid">
  328. <div class="col-md-4">.col-md-4</div>
  329. <div class="col-md-4 col-md-offset-4">.col-md-4 .col-md-offset-4</div>
  330. </div>
  331. <div class="row show-grid">
  332. <div class="col-md-3 col-md-offset-3">.col-md-3 .col-md-offset-3</div>
  333. <div class="col-md-3 col-md-offset-3">.col-md-3 .col-md-offset-3</div>
  334. </div>
  335. <div class="row show-grid">
  336. <div class="col-md-6 col-md-offset-3">.col-md-6 .col-md-offset-3</div>
  337. </div>
  338. </div>
  339. </div>
  340. </div>
  341. </div>
  342. <div class="row">
  343. <div class="col-sm-12">
  344. <div class="ibox float-e-margins">
  345. <div class="ibox-title">
  346. <h5>嵌套列</h5>
  347. <div class="ibox-tools">
  348. <a class="collapse-link">
  349. <i class="fa fa-chevron-up"></i>
  350. </a>
  351. <a class="dropdown-toggle" data-toggle="dropdown" href="grid_options.html#">
  352. <i class="fa fa-wrench"></i>
  353. </a>
  354. <ul class="dropdown-menu dropdown-user">
  355. <li><a href="grid_options.html#">选项1</a>
  356. </li>
  357. <li><a href="grid_options.html#">选项2</a>
  358. </li>
  359. </ul>
  360. <a class="close-link">
  361. <i class="fa fa-times"></i>
  362. </a>
  363. </div>
  364. </div>
  365. <div class="ibox-content">
  366. <p>为了使用内置的栅格系统将内容再次嵌套,可以通过添加一个新的 <code>.row</code> 元素和一系列 <code>.col-sm-*</code> 元素到已经存在的 <code>.col-sm-*</code> 元素内。被嵌套的行(row)所包含的列(column)的个数不能超过12(其实,没有要求你必须占满12列)。</p>
  367. <div class="row show-grid">
  368. <div class="col-md-9">
  369. 第一级: .col-md-9
  370. <div class="row show-grid">
  371. <div class="col-md-6">
  372. 第二级: .col-md-6
  373. </div>
  374. <div class="col-md-6">
  375. 第二级: .col-md-6
  376. </div>
  377. </div>
  378. </div>
  379. </div>
  380. </div>
  381. </div>
  382. </div>
  383. </div>
  384. <div class="row">
  385. <div class="col-sm-12">
  386. <div class="ibox float-e-margins">
  387. <div class="ibox-title">
  388. <h5>列排序</h5>
  389. <div class="ibox-tools">
  390. <a class="collapse-link">
  391. <i class="fa fa-chevron-up"></i>
  392. </a>
  393. <a class="dropdown-toggle" data-toggle="dropdown" href="grid_options.html#">
  394. <i class="fa fa-wrench"></i>
  395. </a>
  396. <ul class="dropdown-menu dropdown-user">
  397. <li><a href="grid_options.html#">选项1</a>
  398. </li>
  399. <li><a href="grid_options.html#">选项2</a>
  400. </li>
  401. </ul>
  402. <a class="close-link">
  403. <i class="fa fa-times"></i>
  404. </a>
  405. </div>
  406. </div>
  407. <div class="ibox-content">
  408. <p>通过使用 <code>.col-md-push-*</code> 和 <code>.col-md-pull-*</code> 类就可以很容易的改变列(column)的顺序。</p>
  409. <div class="row show-grid">
  410. <div class="col-md-9 col-md-push-3">.col-md-9 .col-md-push-3</div>
  411. <div class="col-md-3 col-md-pull-9">.col-md-3 .col-md-pull-9</div>
  412. </div>
  413. </div>
  414. </div>
  415. </div>
  416. </div>
  417. </div>
  418. <!-- 全局js -->
  419. <script src="js/jquery.min.js?v=2.1.4"></script>
  420. <script src="js/bootstrap.min.js?v=3.3.7"></script>
  421. <!-- Peity -->
  422. <script src="js/plugins/peity/jquery.peity.min.js"></script>
  423. <!-- 自定义js -->
  424. <script src="js/content.js?v=1.0.0"></script>
  425. <!-- iCheck -->
  426. <script src="js/plugins/iCheck/icheck.min.js"></script>
  427. <!-- Peity -->
  428. <script src="js/demo/peity-demo.js"></script>
  429. <script>
  430. $(document).ready(function () {
  431. $('.i-checks').iCheck({
  432. checkboxClass: 'icheckbox_square-green',
  433. radioClass: 'iradio_square-green',
  434. });
  435. });
  436. </script>
  437. <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
  438. <!--统计代码,可删除-->
  439. </body>
  440. </html>