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.

440 lines
15 KiB

  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 Properities -->
  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 inverted block 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>Page Grid</h3>
  46. <p>A <code>page grid</code> uses <code>padding</code> to create fluid page gutters. Each columns width will continuously adjust as your browser width changes to maintain the same percentage of overall browser width.</p>
  47. <p>A page grid adjusts its gutters as a percentage of total page width for each device. This causes it to snap to a new width on each breakpoint.</p>
  48. </div>
  49. <div class="ui page grid">
  50. <div class="column"></div>
  51. <div class="column"></div>
  52. <div class="column"></div>
  53. <div class="column"></div>
  54. <div class="column"></div>
  55. <div class="column"></div>
  56. <div class="column"></div>
  57. <div class="column"></div>
  58. <div class="column"></div>
  59. <div class="column"></div>
  60. <div class="column"></div>
  61. <div class="column"></div>
  62. <div class="column"></div>
  63. <div class="column"></div>
  64. <div class="column"></div>
  65. <div class="column"></div>
  66. </div>
  67. <div class="ui text container">
  68. <h3 class="first">Text Container</h3>
  69. <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.
  70. </p>
  71. <p>Text containers <b>do not need to use grids</b> and help simplify basic page layouts.</p>
  72. </div>
  73. <div class="ui text container">
  74. <div class="ui one column grid">
  75. <div class="column"></div>
  76. </div>
  77. </div>
  78. <div class="ui text container">
  79. <h1 class="ui inverted block header">Grid Content</h1>
  80. <h3 class="first">Column Flow</h3>
  81. <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>
  82. <div class="ui grid">
  83. <div class="four wide column"></div>
  84. <div class="four wide column"></div>
  85. <div class="four wide column"></div>
  86. <div class="four wide column"></div>
  87. <div class="four wide column"></div>
  88. <div class="four wide column"></div>
  89. <div class="four wide column"></div>
  90. <div class="four wide column"></div>
  91. </div>
  92. <h3>Clearing Rows</h3>
  93. <p>Adding row wrappers allow you to manually specify you want a new row to begin.</p>
  94. <div class="ui three column grid">
  95. <div class="column"></div>
  96. <div class="row">
  97. <div class="column"></div>
  98. <div class="column"></div>
  99. <div class="column"></div>
  100. </div>
  101. </div>
  102. <h3>Specifying Row Width</h3>
  103. <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>
  104. <div class="ui three column grid">
  105. <div class="column">column</div>
  106. <div class="column">column</div>
  107. <div class="column">column</div>
  108. <div class="column">column</div>
  109. <div class="column">column</div>
  110. <div class="column">column</div>
  111. </div>
  112. <h3>Specifying Column Width</h3>
  113. <p>You can also specify column widths for each column individually</p>
  114. <div class="ui three column grid">
  115. <div class="four wide column">four wide column</div>
  116. <div class="eight wide column">eight wide column</div>
  117. <div class="four wide column">four wide column</div>
  118. </div>
  119. <h3>Special Variations</h3>
  120. <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>
  121. <div class="ui horizontal section divider">Celled Grid</div>
  122. <div class="ui celled grid">
  123. <div class="row">
  124. <div class="four wide column"></div>
  125. <div class="four wide column"></div>
  126. <div class="four wide column"></div>
  127. <div class="four wide column"></div>
  128. </div>
  129. <div class="row">
  130. <div class="four wide column"></div>
  131. <div class="four wide column"></div>
  132. <div class="four wide column"></div>
  133. <div class="four wide column"></div>
  134. </div>
  135. </div>
  136. <div class="ui horizontal section divider">Internally Celled Grid</div>
  137. <div class="ui internally celled grid">
  138. <div class="row">
  139. <div class="four wide column"></div>
  140. <div class="four wide column"></div>
  141. <div class="four wide column"></div>
  142. <div class="four wide column"></div>
  143. </div>
  144. <div class="row">
  145. <div class="four wide column"></div>
  146. <div class="four wide column"></div>
  147. <div class="four wide column"></div>
  148. <div class="four wide column"></div>
  149. </div>
  150. </div>
  151. <div class="ui horizontal section divider">Divided Grid</div>
  152. <div class="ui divided grid">
  153. <div class="row">
  154. <div class="four wide column"></div>
  155. <div class="four wide column"></div>
  156. <div class="four wide column"></div>
  157. <div class="four wide column"></div>
  158. </div>
  159. <div class="row">
  160. <div class="four wide column"></div>
  161. <div class="four wide column"></div>
  162. <div class="four wide column"></div>
  163. <div class="four wide column"></div>
  164. </div>
  165. </div>
  166. <div class="ui horizontal section divider">Vertically Divided Grid</div>
  167. <div class="ui vertically divided grid">
  168. <div class="row">
  169. <div class="four wide column"></div>
  170. <div class="four wide column"></div>
  171. <div class="four wide column"></div>
  172. <div class="four wide column"></div>
  173. </div>
  174. <div class="row">
  175. <div class="four wide column"></div>
  176. <div class="four wide column"></div>
  177. <div class="four wide column"></div>
  178. <div class="four wide column"></div>
  179. </div>
  180. </div>
  181. <h1 class="ui inverted block header">Adjusting Grids</h1>
  182. <h3 class="first">Centering Content</h3>
  183. <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.
  184. </p>
  185. <div class="ui two column centered grid">
  186. <div class="column"></div>
  187. <div class="four column centered row">
  188. <div class="column"></div>
  189. <div class="column"></div>
  190. </div>
  191. </div>
  192. <h3>Floating Rows</h3>
  193. <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>
  194. <div class="ui grid">
  195. <div class="left floated six wide column">
  196. <div class="ui segment">
  197. Left floated
  198. </div>
  199. </div>
  200. <div class="right floated six wide column">
  201. <div class="ui segment">
  202. Right floated
  203. </div>
  204. </div>
  205. </div>
  206. <h3>Text Alignment</h3>
  207. <p>You can specify text alignment using alignment variations on a grid, row, or column level.</p>
  208. <div class="ui grid">
  209. <div class="right aligned eight wide column">
  210. right aligned column
  211. </div>
  212. <div class="left aligned eight wide column">
  213. left aligned column
  214. </div>
  215. <div class="center aligned two column row">
  216. <div class="column">
  217. Center aligned row
  218. </div>
  219. <div class="column">
  220. Center aligned row
  221. </div>
  222. </div>
  223. <div class="sixteen wide column">
  224. Right Aligned Grid
  225. </div>
  226. </div>
  227. <h3>Vertical Alignment</h3>
  228. <p>You can specify vertical alignment on a grid, row, or column level.</p>
  229. <div class="ui middle aligned four column centered grid">
  230. <div class="row">
  231. <div class="column">
  232. <img class="ui wireframe image" src="assets/images/wireframe/image.png">
  233. </div>
  234. <div class="column">
  235. <img class="ui wireframe image" src="assets/images/wireframe/image.png">
  236. <img class="ui wireframe image" src="assets/images/wireframe/image.png">
  237. </div>
  238. <div class="column">
  239. <img class="ui wireframe image" src="assets/images/wireframe/image.png">
  240. </div>
  241. </div>
  242. </div>
  243. <h3>Equal Width Columns</h3>
  244. <p>Specifying an <code>equal width grid</code> will automatically determine column sizes to fit evenly inside one row</p>
  245. <div class="ui equal width grid">
  246. <div class="row">
  247. <div class="column">column</div>
  248. <div class="column">column</div>
  249. <div class="column">column</div>
  250. <div class="column">column</div>
  251. </div>
  252. <div class="row">
  253. <div class="column">column</div>
  254. <div class="column">column</div>
  255. <div class="column">column</div>
  256. </div>
  257. </div>
  258. <h1>Responsive Patterns</h1>
  259. <h3 class="first">Doubling</h3>
  260. <p>You can set columns to double in width at each device jump</p>
  261. <div class="ui five column doubling grid">
  262. <div class="column">column</div>
  263. <div class="column">column</div>
  264. <div class="column">column</div>
  265. <div class="column">column</div>
  266. <div class="column">column</div>
  267. </div>
  268. <h3>Stackable</h3>
  269. <p>You can set columns to stack on mobile</p>
  270. <div class="ui three column stackable grid">
  271. <div class="column">column</div>
  272. <div class="column">column</div>
  273. <div class="column">column</div>
  274. </div>
  275. <h3>Responsive Width Adjustments</h3>
  276. <p>You can specify columns to appear at different widths on different screens</p>
  277. <div class="ui grid">
  278. <div class="eight wide mobile six wide tablet four wide computer column"></div>
  279. <div class="eight wide mobile six wide tablet four wide computer column"></div>
  280. <div class="eight wide mobile six wide tablet four wide computer column"></div>
  281. <div class="eight wide mobile six wide tablet four wide computer column"></div>
  282. <div class="eight wide mobile six wide tablet four wide computer column"></div>
  283. </div>
  284. <div class="ui grid">
  285. <div class="four wide two wide large screen one wide widescreen column"></div>
  286. <div class="four wide two wide large screen one wide widescreen column"></div>
  287. <div class="four wide two wide large screen one wide widescreen column"></div>
  288. <div class="four wide two wide large screen one wide widescreen column"></div>
  289. </div>
  290. <h3>Specifying Device Visibility</h3>
  291. <p>You can specify columns to appear only a particular screen</p>
  292. <div class="ui grid">
  293. <div class="two column computer only row">
  294. <div class="ten wide column">ten wide column computer only</div>
  295. <div class="six wide column">six wide column computer only</div>
  296. </div>
  297. <div class="sixteen wide mobile only column">sixteen wide column mobile only</div>
  298. <div class="three column computer only row">
  299. <div class="column">computer only row</div>
  300. <div class="column">computer only row</div>
  301. <div class="column">computer only row</div>
  302. </div>
  303. <div class="two column mobile only row">
  304. <div class="column">mobile only column</div>
  305. <div class="column">mobile only column</div>
  306. </div>
  307. <div class="two column row">
  308. <div class="column">column</div>
  309. <div class="column">column</div>
  310. </div>
  311. </div>
  312. </div>
  313. </div>
  314. <style type="text/css">
  315. /* Some basic formatting */
  316. code {
  317. background-color: #E0E0E0;
  318. padding: 0.25em 0.3em;
  319. font-family: 'Lato';
  320. font-weight: bold;
  321. }
  322. .container {
  323. padding: 5em 0em;
  324. }
  325. .ui.block.header,
  326. .first {
  327. margin-top: 5em;
  328. }
  329. .ui.block.header:first-child {
  330. margin-top: 0em;
  331. }
  332. .ui.block.header {
  333. margin-left: -4rem;
  334. margin-right: -4rem;
  335. padding-left: 4rem;
  336. padding-right: 4rem;
  337. }
  338. h1,
  339. h3 {
  340. margin-top: 10em;
  341. }
  342. img {
  343. display: block;
  344. max-width: 100%;
  345. }
  346. img + img {
  347. margin-top: 0.5em;
  348. }
  349. /* Shows content box (not negative margins) */
  350. .grid {
  351. position: relative;
  352. }
  353. .grid:before {
  354. position: absolute;
  355. top: 1rem;
  356. left: 1rem;
  357. background-color: #F0F0F0;
  358. content: '';
  359. width: calc(100% - 2rem);
  360. height: calc(100% - 2rem);
  361. box-shadow: 0px 0px 0px 1px #DDDDDD inset;
  362. }
  363. .ui.divided.grid:before,
  364. .celled.grid:before {
  365. display: none;
  366. }
  367. .ui.aligned .column:after {
  368. display: none !important;
  369. }
  370. .grid .column:not(.row):not(.grid):after {
  371. background-color: rgba(86, 61, 124, .15);
  372. box-shadow: 0px 0px 0px 1px rgba(86, 61, 124, 0.2) inset;
  373. content: "";
  374. display: block;
  375. min-height: 50px;
  376. }
  377. @media only screen and (max-width: 768px) {
  378. .stackable.grid:before {
  379. width: 100%;
  380. left: 0em;
  381. }
  382. }
  383. </style>
  384. </body>
  385. </html>