设为首页收藏本站
天天打卡

 找回密码
 立即注册
搜索
查看: 42|回复: 7

AmazeUI 网格的实现示例

[复制链接]

2

主题

61

回帖

166

积分

注册会员

积分
166
发表于 2024-4-20 10:31:47 | 显示全部楼层 |阅读模式
本文主要介绍了AmazeUI 网格的实现示例,分享给大家,也给自己留个笔记。具体如下:
  1. <!doctype html>
  2. <html class="no-js">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="description" content="">
  7. <meta name="keywords" content="">
  8. <meta name="viewport" content="width=device-width, initial-scale=1">
  9. <title>网格</title>
  10. <meta name="renderer" content="webkit">
  11. <meta http-equiv="Cache-Control" content="no-siteapp"/>
  12. <link rel="icon" type="image/png" href="assets/i/favicon.png">
  13. <meta name="mobile-web-app-capable" content="yes">
  14. <link rel="icon" sizes="192x192" href="assets/i/app-icon72x72@2x.png">
  15. <meta name="apple-mobile-web-app-capable" content="yes">
  16. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  17. <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
  18. <link rel="apple-touch-icon-precomposed" href="assets/i/app-icon72x72@2x.png">
  19. <meta name="msapplication-TileImage" content="assets/i/app-icon72x72@2x.png">
  20. <meta name="msapplication-TileColor" content="#0e90d2">
  21. <link rel="stylesheet" href="assets/css/amazeui.min.css">
  22. <style>
  23. div>div:nth-child(1){background-color: #06f;}
  24. div>div:nth-child(2){background-color: #0f6;}
  25. div>div:nth-child(3){background-color: #60f;}
  26. div>div:nth-child(4){background-color: #6f0;}
  27. div>div:nth-child(5){background-color: #f60;}
  28. div>div:nth-child(6){background-color: #f06;}
  29. </style>
  30. </head>
  31. <body>
  32. <h3>示例 1:一个基本的网格</h3>
  33. <div class="am-g">
  34.   <div class="am-u-sm-4">4</div>
  35.   <div class="am-u-sm-8">8</div>
  36. </div>

  37. <h3>示例 2:不同区间不同的划分比例</h3>
  38. <div class="am-g doc-am-g">
  39.   <div class="am-u-sm-6 am-u-md-4 am-u-lg-3">sm-6 md-4 lg-3</div>
  40.   <div class="am-u-sm-6 am-u-md-8 am-u-lg-9">sm-6 md-8 lg-9</div>
  41. </div>

  42. <h3>示例 3:限制宽度的网格</h3>
  43. <div class="am-g am-g-fixed">
  44.   <div class="am-u-sm-4">4</div>
  45.   <div class="am-u-sm-8">8</div>
  46. </div>

  47. <h4>示例 4:容器</h4>
  48. <div class="am-container">
  49.   <div class="am-g">
  50.     <div class="am-u-sm-6">.am-u-sm-6</div>
  51.     <div class="am-u-sm-6">.am-u-sm-6</div>
  52.   </div>
  53. </div>

  54. <h3>示例 5:不足 12 份的网格</h3>
  55. <!-- 未添加 .am-u-end 的情形 -->
  56. <div class="am-g">
  57.   <div class="am-u-sm-3">3</div>
  58.   <div class="am-u-sm-3">3</div>
  59.   <div class="am-u-sm-3">3</div>
  60. </div>
  61. <!-- 添加 .am-u-end 后 -->
  62. <div class="am-g">
  63.   <div class="am-u-sm-3">3</div>
  64.   <div class="am-u-sm-3">3</div>
  65.   <div class="am-u-sm-3 am-u-end">3</div>
  66. </div>

  67. <h3>示例 6:响应式辅助类控制元素显隐</h3>
  68. <div class="am-g">
  69.   <div class="am-u-sm-2 am-u-lg-4">
  70.     <span class="am-show-md-down">sm-2</span>
  71.     <span class="am-show-lg-only">lg-4</span>
  72.   </div>
  73.   <div class="am-u-sm-4 am-u-lg-4">sm4 lg4</div>
  74.   <div class="am-u-sm-6 am-u-lg-4">
  75.     <span class="am-show-md-down">sm-6</span>
  76.     <span class="am-show-lg-only">lg-4</span>
  77.   </div>
  78. </div>
  79. <div class="am-g">
  80.   <div class="am-u-lg-3">
  81.     <span class="am-show-md-down">sm-full</span>
  82.     <span class="am-show-lg-only">lg-3</span>
  83.   </div>
  84.   <div class="am-u-lg-6">
  85.     <span class="am-show-md-down">sm-full</span>
  86.     <span class="am-show-lg-only">lg-6</span>
  87.   </div>
  88.   <div class="am-u-lg-3">
  89.     <span class="am-show-md-down">sm-full</span>
  90.     <span class="am-show-lg-only">lg-3</span>
  91.   </div>
  92. </div>
  93. <div class="am-g">
  94.   <div class="am-u-sm-6 am-u-lg-2">
  95.     <span class="am-show-md-down">6</span>
  96.     <span class="am-hide-md-down">2</span>
  97.   </div>
  98.   <div class="am-u-sm-6 am-u-lg-8">
  99.     <span class="am-show-md-down">6</span>
  100.     <span class="am-hide-md-down">8</span>
  101.   </div>
  102.   <div class="am-u-sm-12 am-u-lg-2">
  103.     <span class="am-show-md-down">full</span>
  104.     <span class="am-hide-md-down">2</span>
  105.   </div>
  106. </div>
  107. <div class="am-g">
  108.   <div class="am-u-sm-3">3</div>
  109.   <div class="am-u-sm-9">9</div>
  110. </div>
  111. <div class="am-g">
  112.   <div class="am-u-lg-4">
  113.     <span class="am-show-md-down">full</span>
  114.     <span class="am-hide-md-down">4</span>
  115.   </div>
  116.   <div class="am-u-lg-8">
  117.     <span class="am-show-md-down">full</span>
  118.     <span class="am-hide-md-down">8</span>
  119.   </div>
  120. </div>
  121. <div class="am-g">
  122.   <div class="am-u-sm-6 am-u-lg-5">
  123.     <span class="am-show-md-down">6</span>
  124.     <span class="am-hide-md-down">5</span>
  125.   </div>
  126.   <div class="am-u-sm-6 am-u-lg-7">
  127.     <span class="am-show-md-down">6</span>
  128.     <span class="am-hide-md-down">7</span>
  129.   </div>
  130. </div>
  131. <div class="am-g">
  132.   <div class="am-u-lg-6">
  133.     <span class="am-show-md-down">full</span>
  134.     <span class="am-hide-md-down">6</span>
  135.   </div>
  136.   <div class="am-u-lg-6">
  137.     <span class="am-show-md-down">full</span>
  138.     <span class="am-hide-md-down">6</span>
  139.   </div>
  140. </div>

  141. <h3>示例 7:列边距啪啪啪</h3>
  142. <div class="am-g">
  143.   <div class="am-u-sm-1">1</div>
  144.   <div class="am-u-sm-11">11</div>
  145. </div>
  146. <div class="am-g">
  147.   <div class="am-u-sm-1">1</div>
  148.   <div class="am-u-sm-10 am-u-sm-offset-1">10, offset 1</div>
  149. </div>
  150. <div class="am-g">
  151.   <div class="am-u-sm-1">1</div>
  152.   <div class="am-u-sm-9 am-u-sm-offset-2">9, offset 2</div>
  153. </div>
  154. <div class="am-g">
  155.   <div class="am-u-sm-1">1</div>
  156.   <div class="am-u-sm-8 am-u-sm-offset-3">8, offset 3</div>
  157. </div>
  158. <div class="am-g">
  159.   <div class="am-u-sm-1">1</div>
  160.   <div class="am-u-sm-7 am-u-sm-offset-4">7, offset 4</div>
  161. </div>

  162. <h3>示例 8:居中, To be or not to be</h3>
  163. <!-- .am-u-sm-centered 始终居中 -->
  164. <div class="am-g">
  165.   <div class="am-u-sm-3 am-u-sm-centered">3 centered</div>
  166. </div>
  167. <!-- .am-u-lg-centered 大于 1024 时居中 -->
  168. <div class="am-g">
  169.   <div class="am-u-sm-6 am-u-lg-centered">6 centered</div>
  170. </div>
  171. <!-- 大于 1024 时不居中 -->
  172. <div class="am-g">
  173.   <div class="am-u-sm-9 am-u-sm-centered am-u-lg-uncentered">9 md-down-centered </div>
  174. </div>
  175. <!-- 始终居中 -->
  176. <div class="am-g">
  177.   <div class="am-u-sm-11 am-u-sm-centered">11 centered</div>
  178. </div>

  179. <h3>示例 9:结构与表现表里不一</h3>
  180. <!--
  181. 结构中 main 在前, sidebar 在后
  182. 通过 push/pull,在 medium 区间将 sidebar 显示到左侧,main 显示到右侧
  183. large 区间 reset 回结构排序
  184. -->
  185. <div class="am-g">
  186.   <div class="am-u-md-8 am-u-md-push-4 am-u-lg-reset-order">8 main</div>
  187.   <div class="am-u-md-4 am-u-md-pull-8 am-u-lg-reset-order">4 sidebar</div>
  188. </div>

  189. <h3>示例 10: 没有内边距的列</h3>
  190. <div class="am-g am-g-collapse">
  191.   <div class="am-u-sm-6">.am-u-sm-6</div>
  192.   <div class="am-u-sm-6">.am-u-sm-6</div>
  193. </div>
  194. <!--[if (gte IE 9)|!(IE)]><!-->
  195. <script src="assets/js/jquery.min.js"></script>
  196. <!--<![endif]-->
  197. <!--[if lte IE 8 ]>
  198. <script src="assets/ie8/jquery.min.js"></script>
  199. <script src="assets/ie8/modernizr.js"></script>
  200. <script src="assets/js/amazeui.ie8polyfill.min.js"></script>
  201. <![endif]-->
  202. <script src="assets/js/amazeui.min.js"></script>
  203. </body>
  204. </html>
复制代码
效果图:

到此这篇关于AmazeUI 网格的实现示例的文章就介绍到这了,更多相关AmazeUI 网格内容请搜索脚本之家以前的文章或继续浏览下面的相关文章,希望大家以后多多支持脚本之家!

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

0

主题

48

回帖

95

积分

注册会员

积分
95
发表于 2024-4-23 22:33:53 | 显示全部楼层
友善的讨论氛围是非常重要的。

3

主题

53

回帖

149

积分

注册会员

积分
149
发表于 2024-5-6 12:41:10 | 显示全部楼层
能给个链接吗?我想深入了解一下。

0

主题

43

回帖

87

积分

注册会员

积分
87
发表于 2024-5-13 00:09:52 | 显示全部楼层
6666666666

0

主题

67

回帖

135

积分

注册会员

积分
135
发表于 2024-5-14 22:45:22 | 显示全部楼层
说得太好了,完全同意!

3

主题

69

回帖

205

积分

中级会员

积分
205
发表于 2024-5-30 00:40:14 | 显示全部楼层
友善的讨论氛围是非常重要的。

1

主题

50

回帖

116

积分

注册会员

积分
116
发表于 2024-6-16 23:29:35 | 显示全部楼层
每日一回

2

主题

36

回帖

118

积分

注册会员

积分
118
发表于 2024-9-4 15:52:37 | 显示全部楼层
太棒了!感谢分享这个信息!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|爱云论坛 - d.taiji888.cn - 技术学习 免费资源分享 ( 蜀ICP备2022010826号 )|天天打卡

GMT+8, 2024-11-15 08:57 , Processed in 0.120957 second(s), 28 queries .

Powered by i云网络 Licensed

© 2023-2028 正版授权

快速回复 返回顶部 返回列表