You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

408 lines
14 KiB

9 years ago
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <!-- Standard Meta -->
  5. <meta charset="utf-8" />
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  8. <!-- Site Properties -->
  9. <title>Grid Example - Semantic</title>
  10. <link rel="stylesheet" type="text/css" href="../dist/components/reset.css">
  11. <link rel="stylesheet" type="text/css" href="../dist/components/site.css">
  12. <link rel="stylesheet" type="text/css" href="../dist/components/container.css">
  13. <link rel="stylesheet" type="text/css" href="../dist/components/divider.css">
  14. <link rel="stylesheet" type="text/css" href="../dist/components/grid.css">
  15. <link rel="stylesheet" type="text/css" href="../dist/components/header.css">
  16. </head>
  17. <body>
  18. <div class="ui text container">
  19. <h1 class="ui dividing header">Using Grids</h1>
  20. <h3 class="first">Container</h3>
  21. <p>A container is a fixed width element that wraps your site's content. It remains a constant size and uses <b>margin</b> to center. Containers are the simplest way to center page content inside a grid.</code>
  22. </p>
  23. </div>
  24. <div class="ui container">
  25. <div class="ui grid">
  26. <div class="column"></div>
  27. <div class="column"></div>
  28. <div class="column"></div>
  29. <div class="column"></div>
  30. <div class="column"></div>
  31. <div class="column"></div>
  32. <div class="column"></div>
  33. <div class="column"></div>
  34. <div class="column"></div>
  35. <div class="column"></div>
  36. <div class="column"></div>
  37. <div class="column"></div>
  38. <div class="column"></div>
  39. <div class="column"></div>
  40. <div class="column"></div>
  41. <div class="column"></div>
  42. </div>
  43. </div>
  44. <div class="ui text container">
  45. <h3 class="first">Text Container</h3>
  46. <p>Sometimes you just need to put a single column of centered text on a page. A <code>text container</code> is a special type of container optimized for a single flowing column of text, like this instructions on this page.
  47. </p>
  48. <p>Text containers <b>do not need to use grids</b> and help simplify basic page layouts.</p>
  49. </div>
  50. <div class="ui text container">
  51. <div class="ui one column grid">
  52. <div class="column"></div>
  53. </div>
  54. </div>
  55. <div class="ui text container">
  56. <h1 class="ui dividing header">Grid Content</h1>
  57. <h3 class="first">Column Flow</h3>
  58. <p>A grid does not necessarily need to specify rows. If you include <code>columns</code> as direct child of <code>ui grid</code> content will automatically flow to the next row when all the grid columns are taken in the current row</b>.</p>
  59. <div class="ui grid">
  60. <div class="four wide column"></div>
  61. <div class="four wide column"></div>
  62. <div class="four wide column"></div>
  63. <div class="four wide column"></div>
  64. <div class="four wide column"></div>
  65. <div class="four wide column"></div>
  66. <div class="four wide column"></div>
  67. <div class="four wide column"></div>
  68. </div>
  69. <h3>Clearing Rows</h3>
  70. <p>Adding row wrappers allow you to manually specify you want a new row to begin.</p>
  71. <div class="ui three column grid">
  72. <div class="column"></div>
  73. <div class="row">
  74. <div class="column"></div>
  75. <div class="column"></div>
  76. <div class="column"></div>
  77. </div>
  78. </div>
  79. <h3>Specifying Row Width</h3>
  80. <p>Specifying a grid column count will divide columns into rows of predetermined column count. Additional columns will automatically flow to the next row.</p>
  81. <div class="ui three column grid">
  82. <div class="column">column</div>
  83. <div class="column">column</div>
  84. <div class="column">column</div>
  85. <div class="column">column</div>
  86. <div class="column">column</div>
  87. <div class="column">column</div>
  88. </div>
  89. <h3>Specifying Column Width</h3>
  90. <p>You can also specify column widths for each column individually</p>
  91. <div class="ui three column grid">
  92. <div class="four wide column">four wide column</div>
  93. <div class="eight wide column">eight wide column</div>
  94. <div class="four wide column">four wide column</div>
  95. </div>
  96. <h3>Special Variations</h3>
  97. <p>Some special variations that format grids like tables require you to specify rows. For example a <code>divided grid</code> or a <code>celled grid</code> requires row wrappers.</p>
  98. <div class="ui horizontal section divider">Celled Grid</div>
  99. <div class="ui celled grid">
  100. <div class="row">
  101. <div class="four wide column"></div>
  102. <div class="four wide column"></div>
  103. <div class="four wide column"></div>
  104. <div class="four wide column"></div>
  105. </div>
  106. <div class="row">
  107. <div class="four wide column"></div>
  108. <div class="four wide column"></div>
  109. <div class="four wide column"></div>
  110. <div class="four wide column"></div>
  111. </div>
  112. </div>
  113. <div class="ui horizontal section divider">Internally Celled Grid</div>
  114. <div class="ui internally celled grid">
  115. <div class="row">
  116. <div class="four wide column"></div>
  117. <div class="four wide column"></div>
  118. <div class="four wide column"></div>
  119. <div class="four wide column"></div>
  120. </div>
  121. <div class="row">
  122. <div class="four wide column"></div>
  123. <div class="four wide column"></div>
  124. <div class="four wide column"></div>
  125. <div class="four wide column"></div>
  126. </div>
  127. </div>
  128. <div class="ui horizontal section divider">Divided Grid</div>
  129. <div class="ui divided grid">
  130. <div class="row">
  131. <div class="four wide column"></div>
  132. <div class="four wide column"></div>
  133. <div class="four wide column"></div>
  134. <div class="four wide column"></div>
  135. </div>
  136. <div class="row">
  137. <div class="four wide column"></div>
  138. <div class="four wide column"></div>
  139. <div class="four wide column"></div>
  140. <div class="four wide column"></div>
  141. </div>
  142. </div>
  143. <div class="ui horizontal section divider">Vertically Divided Grid</div>
  144. <div class="ui vertically divided grid">
  145. <div class="row">
  146. <div class="four wide column"></div>
  147. <div class="four wide column"></div>
  148. <div class="four wide column"></div>
  149. <div class="four wide column"></div>
  150. </div>
  151. <div class="row">
  152. <div class="four wide column"></div>
  153. <div class="four wide column"></div>
  154. <div class="four wide column"></div>
  155. <div class="four wide column"></div>
  156. </div>
  157. </div>
  158. <h1 class="ui dividing header">Adjusting Grids</h1>
  159. <h3 class="first">Centering Content</h3>
  160. <p>If a row does not take up all sixteen grid columns, you can use a <code>ui centered grid</code>, <code>centered row</code>, or <code>centered column</code> to center the column contents inside the grid.
  161. </p>
  162. <div class="ui two column centered grid">
  163. <div class="column"></div>
  164. <div class="four column centered row">
  165. <div class="column"></div>
  166. <div class="column"></div>
  167. </div>
  168. </div>
  169. <h3>Floating Rows</h3>
  170. <p>Since Semantic UI's grid is based on flex box, a <code>left floated</code> item should come first, and a <code>right floated</code> item last in its row.</p>
  171. <div class="ui grid">
  172. <div class="left floated six wide column">
  173. <div class="ui segment">
  174. Left floated
  175. </div>
  176. </div>
  177. <div class="right floated six wide column">
  178. <div class="ui segment">
  179. Right floated
  180. </div>
  181. </div>
  182. </div>
  183. <h3>Text Alignment</h3>
  184. <p>You can specify text alignment using alignment variations on a grid, row, or column level.</p>
  185. <div class="ui grid">
  186. <div class="right aligned eight wide column">
  187. right aligned column
  188. </div>
  189. <div class="left aligned eight wide column">
  190. left aligned column
  191. </div>
  192. <div class="center aligned two column row">
  193. <div class="column">
  194. center aligned row
  195. </div>
  196. <div class="column">
  197. center aligned row
  198. </div>
  199. </div>
  200. <div class="sixteen wide right aligned column">
  201. right aligned column
  202. </div>
  203. </div>
  204. <h3>Vertical Alignment</h3>
  205. <p>You can specify vertical alignment on a grid, row, or column level.</p>
  206. <div class="ui middle aligned four column centered grid">
  207. <div class="row">
  208. <div class="column">
  209. <img class="ui wireframe image" src="assets/images/wireframe/image.png">
  210. </div>
  211. <div class="column">
  212. <img class="ui wireframe image" src="assets/images/wireframe/image.png">
  213. <img class="ui wireframe image" src="assets/images/wireframe/image.png">
  214. </div>
  215. <div class="column">
  216. <img class="ui wireframe image" src="assets/images/wireframe/image.png">
  217. </div>
  218. </div>
  219. </div>
  220. <h3>Equal Width Columns</h3>
  221. <p>Specifying an <code>equal width grid</code> will automatically determine column sizes to fit evenly inside one row</p>
  222. <div class="ui equal width grid">
  223. <div class="row">
  224. <div class="column">column</div>
  225. <div class="column">column</div>
  226. <div class="column">column</div>
  227. <div class="column">column</div>
  228. </div>
  229. <div class="row">
  230. <div class="column">column</div>
  231. <div class="column">column</div>
  232. <div class="column">column</div>
  233. </div>
  234. </div>
  235. <h1>Responsive Patterns</h1>
  236. <h3 class="first">Doubling</h3>
  237. <p>You can set columns to double in width at each device jump</p>
  238. <div class="ui five column doubling grid">
  239. <div class="column">column</div>
  240. <div class="column">column</div>
  241. <div class="column">column</div>
  242. <div class="column">column</div>
  243. <div class="column">column</div>
  244. </div>
  245. <h3>Stackable</h3>
  246. <p>You can set columns to stack on mobile</p>
  247. <div class="ui three column stackable grid">
  248. <div class="column">column</div>
  249. <div class="column">column</div>
  250. <div class="column">column</div>
  251. </div>
  252. <h3>Responsive Width Adjustments</h3>
  253. <p>You can specify columns to appear at different widths on different screens</p>
  254. <div class="ui grid">
  255. <div class="eight wide mobile six wide tablet four wide computer column"></div>
  256. <div class="eight wide mobile six wide tablet four wide computer column"></div>
  257. <div class="eight wide mobile six wide tablet four wide computer column"></div>
  258. <div class="eight wide mobile six wide tablet four wide computer column"></div>
  259. <div class="eight wide mobile six wide tablet four wide computer column"></div>
  260. </div>
  261. <div class="ui grid">
  262. <div class="four wide two wide large screen one wide widescreen column"></div>
  263. <div class="four wide two wide large screen one wide widescreen column"></div>
  264. <div class="four wide two wide large screen one wide widescreen column"></div>
  265. <div class="four wide two wide large screen one wide widescreen column"></div>
  266. </div>
  267. <h3>Specifying Device Visibility</h3>
  268. <p>You can specify columns to appear only a particular screen</p>
  269. <div class="ui grid">
  270. <div class="two column computer only row">
  271. <div class="ten wide column">ten wide column computer only</div>
  272. <div class="six wide column">six wide column computer only</div>
  273. </div>
  274. <div class="sixteen wide mobile only column">sixteen wide column mobile only</div>
  275. <div class="three column computer only row">
  276. <div class="column">computer only row</div>
  277. <div class="column">computer only row</div>
  278. <div class="column">computer only row</div>
  279. </div>
  280. <div class="two column mobile only row">
  281. <div class="column">mobile only column</div>
  282. <div class="column">mobile only column</div>
  283. </div>
  284. <div class="two column row">
  285. <div class="column">column</div>
  286. <div class="column">column</div>
  287. </div>
  288. </div>
  289. </div>
  290. </div>
  291. <style type="text/css">
  292. /* Some basic formatting */
  293. code {
  294. background-color: #E0E0E0;
  295. padding: 0.25em 0.3em;
  296. font-family: 'Lato';
  297. font-weight: bold;
  298. }
  299. .container {
  300. padding: 5em 0em;
  301. }
  302. .ui.dividing.header,
  303. .first {
  304. margin-top: 5em;
  305. }
  306. .ui.dividing.header:first-child {
  307. margin-top: 0em;
  308. }
  309. h1,
  310. h3 {
  311. margin-top: 10em;
  312. }
  313. img {
  314. display: block;
  315. max-width: 100%;
  316. }
  317. img + img {
  318. margin-top: 0.5em;
  319. }
  320. /* Shows content box (not negative margins) */
  321. .grid {
  322. position: relative;
  323. }
  324. .grid:before {
  325. position: absolute;
  326. top: 1rem;
  327. left: 1rem;
  328. background-color: #F0F0F0;
  329. content: '';
  330. width: calc(100% - 2rem);
  331. height: calc(100% - 2rem);
  332. box-shadow: 0px 0px 0px 1px #DDDDDD inset;
  333. }
  334. .ui.divided.grid:before,
  335. .celled.grid:before {
  336. display: none;
  337. }
  338. .ui.aligned .column:after {
  339. display: none !important;
  340. }
  341. .grid .column:not(.row):not(.grid):after {
  342. background-color: rgba(86, 61, 124, .15);
  343. box-shadow: 0px 0px 0px 1px rgba(86, 61, 124, 0.2) inset;
  344. content: "";
  345. display: block;
  346. min-height: 50px;
  347. }
  348. @media only screen and (max-width: 768px) {
  349. .stackable.grid:before {
  350. width: 100%;
  351. left: 0em;
  352. }
  353. }
  354. </style>
  355. </body>
  356. </html>