资讯专栏INFORMATION COLUMN

Flex 学习

番茄西红柿 / 3613人阅读

摘要:案例一无标题

Flex案例一:

</>复制代码

  1. 1 <html>
  2. 2 <head>
  3. 3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. 4 <title>无标题title>
  5. 5 <style type="text/css">
  6. 6 body,h1,h2,h3,h4,h5,h6,dl,dt,dd,ul,ol,li,th,td,p,blockquote,pre,form,fieldset,legend,input,button,textarea,hr{
  7. 7 margin:0;
  8. 8 padding:0;
  9. 9 }
  10. 10 body{
  11. 11 display: flex;
  12. 12 background: -webkit-linear-gradient(top,#222,#333);
  13. 13 background: linear-gradient(top,#222,#333);
  14. 14 justify-content:center;
  15. 15 align-items:center;
  16. 16 align-content:center;
  17. 17 flex-wrap:wrap;
  18. 18 position:relative;
  19. 19 }
  20. 20 [class$="box"]{
  21. 21 background-color: #e7e7e7;
  22. 22 width: 104px;
  23. 23 height: 104px;
  24. 24 /*padding:4px;
  25. 25 margin:16px;*/
  26. 26 object-fit:contain;
  27. 27 border-radius: 10%;
  28. 28 box-shadow: inset 0 5px white,inset 0 -5px #bbb,inset 5px 0 #d7d7d7,inset -5px 0 #d7d7d7;
  29. 29 display: flex;
  30. 30
  31. 31 position: absolute;
  32. 32 top:0;
  33. 33 left: 0;
  34. 34 /*top: 40%;
  35. 35 left: 40%;*/
  36. 36 }
  37. 37 [class="item"]{
  38. 38 display: block;
  39. 39 width:24px;
  40. 40 height: 24px;
  41. 41 border-radius: 50%;
  42. 42 margin:4px;
  43. 43 background-color: #333;
  44. 44 box-shadow: inset 0 3px #111,inset 0 -3px #555;
  45. 45 }
  46. 46 .first-box{
  47. 47 justify-content:center;
  48. 48 align-items:center;
  49. 49 align-content:center;
  50. 50 }
  51. 51 .second-box{
  52. 52 justify-content:space-between;
  53. 53 }
  54. 54 .second-box .item:nth-of-type(2){
  55. 55 -webkit-align-self:flex-end;
  56. 56 }
  57. 57 .third-box{
  58. 58
  59. 59 }
  60. 60 .third-box .item:nth-of-type(2){
  61. 61 align-self:center;
  62. 62 }
  63. 63 .third-box .item:nth-of-type(3){
  64. 64 align-self:flex-end;
  65. 65 }
  66. 66 .sixth-box,
  67. 67 .four-box{
  68. 68 justify-content:space-between;
  69. 69 justify-wrap:wrap;
  70. 70 }
  71. 71 .sixth-box .column,
  72. 72 .four-box .column{
  73. 73 display: flex;
  74. 74 flex-direction:column;
  75. 75 justify-content:space-between;
  76. 76 }
  77. 77 .fifth-box{
  78. 78 justify-content:space-between;
  79. 79 }
  80. 80 .fifth-box .column{
  81. 81 display: flex;
  82. 82 flex-direction:column;
  83. 83 justify-content:space-between;
  84. 84 }
  85. 85 .fifth-box .column:nth-of-type(2){
  86. 86 justify-content:center;
  87. 87 align-items:center;
  88. 88 }
  89. 89
  90. 90 .tbox{
  91. 91 width: 104px;
  92. 92 height: 104px;
  93. 93
  94. 94 background-color: transparent;
  95. 95 border:none;
  96. 96 box-shadow: none;
  97. 97 transform-style:preserve-3d;
  98. 98 display: flex;
  99. 99 justify-content:center;
  100. 100 align-items:center;
  101. 101 align-content:center;
  102. 102 flex-wrap:wrap;
  103. 103 position:relative;
  104. 104 -webkit-animation:iphone 4s linear infinite;
  105. 105
  106. 106 transform:rotateZ(30deg);
  107. 107 }
  108. 108 .tbox:hover{
  109. 109 -webkit-animation-play-state:paused;
  110. 110 }
  111. 111 .sixth-box{
  112. 112 /*transform:rotate(30deg);*/
  113. 113 transform-origin:right bottom;
  114. 114 transform:rotateZ(30deg);
  115. 115 }
  116. 116 .fifth-box{
  117. 117 margin-left: 25px;
  118. 118 margin-top: 7px;
  119. 119 transform-origin:right 50%;
  120. 120 transform:translateZ(-105px) rotateY(90deg) rotateX(-29deg);
  121. 121 }
  122. 122 .four-box{
  123. 123 margin-left: 40px;
  124. 124 margin-top: -45px;
  125. 125 /*margin-top: -36px;*/
  126. 126 transform-origin:left 50%;
  127. 127 transform:translateZ(-105px) rotateY(-90deg) rotateX(30deg);
  128. 128 }
  129. 129 .third-box{
  130. 130 margin-left: 40px;
  131. 131 margin-top:-45px;
  132. 132 /*margin-left: 240px;*/
  133. 133 transform-origin:left 50%;
  134. 134 transform:translateZ(-105px) rotateZ(30deg);
  135. 135 }
  136. 136 .second-box{
  137. 137 margin-left: 7px;
  138. 138 margin-top:80px;
  139. 139 /*margin-top: 128px;*/
  140. 140 transform-origin: 50% top;
  141. 141 transform:translateZ(-105px) rotateX(90deg) rotateY(30deg);
  142. 142 }
  143. 143 .first-box{
  144. 144 margin-left:58px;
  145. 145 margin-top:-116px;
  146. 146 /*margin-top: -96px;*/
  147. 147 transform-origin: 50% bottom;
  148. 148 transform:translateZ(-105px) rotateX(-90deg) rotateY(-30deg);
  149. 149 }
  150. 150
  151. 151 @-webkit-keyframes iphone{
  152. 152 from{
  153. 153 transform:rotateY(0deg);
  154. 154 }
  155. 155 to{
  156. 156 transform:rotateY(360deg);
  157. 157 }
  158. 158 }
  159. 159 style>
  160. 160 head>
  161. 161 <body>
  162. 162 <div class="tbox">
  163. 163 <div class="first-box">
  164. 164 <span class="item">span>
  165. 165 div>
  166. 166 <div class="second-box">
  167. 167 <span class="item">span>
  168. 168 <span class="item">span>
  169. 169 div>
  170. 170 <div class="third-box">
  171. 171 <span class="item">span>
  172. 172 <span class="item">span>
  173. 173 <span class="item">span>
  174. 174 div>
  175. 175 <div class="four-box">
  176. 176 <div class="column">
  177. 177 <span class="item">span>
  178. 178 <span class="item">span>
  179. 179 div>
  180. 180 <div class="column">
  181. 181 <span class="item">span>
  182. 182 <span class="item">span>
  183. 183 div>
  184. 184 div>
  185. 185 <div class="fifth-box">
  186. 186 <div class="column">
  187. 187 <span class="item">span>
  188. 188 <span class="item">span>
  189. 189 div>
  190. 190 <div class="column">
  191. 191 <span class="item">span>
  192. 192 div>
  193. 193 <div class="column">
  194. 194 <span class="item">span>
  195. 195 <span class="item">span>
  196. 196 div>
  197. 197 div>
  198. 198 <div class="sixth-box">
  199. 199 <div class="column">
  200. 200 <span class="item">span>
  201. 201 <span class="item">span>
  202. 202 <span class="item">span>
  203. 203 div>
  204. 204 <div class="column">
  205. 205 <span class="item">span>
  206. 206 <span class="item">span>
  207. 207 <span class="item">span>
  208. 208 div>
  209. 209 div>
  210. 210 div>
  211. 211
  212. 212 body>
  213. 213 html>
View Code

 

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/2023.html

相关文章

  • 初步学习弹性布局

    摘要:今天刚刚学习了微信小程序,学习微信小程序之前首先得熟悉弹性布局如果把一个元素设置为,它的所有子元素都成为容器成员,称之为项目,并且,子元素的和属性都会失效。以下介绍弹性布局设置在容器上的种属性。与交叉轴两端对齐,轴线之间的间隔平均分布。 今天刚刚学习了微信小程序,学习微信小程序之前首先得熟悉弹性布局showImg(https://segmentfault.com/img/bVYNPQ?...

    Code4App 评论0 收藏0
  • 初步学习弹性布局

    摘要:今天刚刚学习了微信小程序,学习微信小程序之前首先得熟悉弹性布局如果把一个元素设置为,它的所有子元素都成为容器成员,称之为项目,并且,子元素的和属性都会失效。以下介绍弹性布局设置在容器上的种属性。与交叉轴两端对齐,轴线之间的间隔平均分布。 今天刚刚学习了微信小程序,学习微信小程序之前首先得熟悉弹性布局showImg(https://segmentfault.com/img/bVYNPQ?...

    syoya 评论0 收藏0
  • FlexBox学习 弹性布局_019

    摘要:学习弹性布局模型,通常被称为,是一种一维的布局模型。任何空间分布都将在该行上发生,而不影响该空间分布的其他行。同时,布局空白对于元素的对齐行为也是很重要的。这会使该元素延展,并占据此方向轴上的布局空白。 FlexBox学习 弹性布局 Flexible Box 模型,通常被称为 flexbox,是一种一维的布局模型。它给 flexbox 的子元素之间提供了强大的空间分布和对齐能力。 一维...

    warnerwu 评论0 收藏0
  • FlexBox学习 弹性布局_019

    摘要:学习弹性布局模型,通常被称为,是一种一维的布局模型。任何空间分布都将在该行上发生,而不影响该空间分布的其他行。同时,布局空白对于元素的对齐行为也是很重要的。这会使该元素延展,并占据此方向轴上的布局空白。 FlexBox学习 弹性布局 Flexible Box 模型,通常被称为 flexbox,是一种一维的布局模型。它给 flexbox 的子元素之间提供了强大的空间分布和对齐能力。 一维...

    MyFaith 评论0 收藏0
  • 学习关于display :flex 布局问题!

    摘要:什么是呢答是的缩写,意为弹性布局这个东西的引入,为盒模型提供了最大的灵活性可以相应式的实现各种页面的布局。基本概念采用布局的元素,称为容器,简称容器。在这个容器中默认存在两个轴水平方向的主轴和垂直方向上的交叉轴。 很多人不明白这个display:flex是到底是什么东西,如何使用的 。 1.什么是display:flex呢? 答:flex是 flexible box的缩写,意为弹性布局 ;...

    番茄西红柿 评论0 收藏0
  • flex布局-学习

    摘要:今天上网找了下各种的博文学习了一番资料如下阮一峰的网络日志年提出了布局特点是简便完整响应式兼容性如下查询链接介绍意思为弹性布局任何一容器都可以指定为布局甚至行内元素也可以但是由于支持的情况各不相同我们还是需要对属性做兼容性处理如加上 今天,上网找了下各种flex的博文学习了一番,资料如下:阮一峰的网络日志Dive into Flexbox2009年,W3C提出了---Flex布局,特点...

    hedzr 评论0 收藏0

发表评论

0条评论

最新活动
阅读需要支付1元查看
<