CSS18. display - grid
描述
Grid,即网格布局。它将页面划分为一个个网格,可以任意组合不同的形态,做出理想的布局效果。Grid布局与Flexbox布局的区别在于,Flexbox是根据轴线对弹性项进行排列,而Grid布局是将容器划分为行和列,产生单元格,然后再对单元格进行操作。HTML/CSS/JavaScript 解法, 执行用时: 1748ms, 内存消耗: 77856KB, 提交时间: 2021-12-26
{"css":"","js":"","html":"<!DOCTYPE html>\n<html>\n <head>\n <meta charset=utf-8>\n <style type=\"text/css\">\n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n section {\n display: grid;\n grid-template-rows: 100px;\n grid-template-columns: repeat(2, 1fr);\n grid-gap: 10px;\n width: 500px;\n text-align: center;\n}\n article {\n height: 100px;\n border: 1px solid black;\n }\n </style>\n </head>\n <body>\n \t<section>\n <article>1</article>\n <article>2</article>\n <article>3</article>\n <article>4</article>\n <article>5</article>\n <article>6</article>\n <article>7</article>\n <article>8</article>\n <article>9</article>\n </section>\n </body>\n</html>","libs":[]}
HTML/CSS/JavaScript 解法, 执行用时: 1751ms, 内存消耗: 77764KB, 提交时间: 2021-12-26
{"css":"","js":"","html":"<!DOCTYPE html>\n<html>\n <head>\n <meta charset=utf-8>\n <style type=\"text/css\">\n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n section {\n width: 500px;\n text-align: center;\n display:grid;\n grid-template-rows: 100px 100px 100px;\n grid-template-columns: repeat(2, 1fr);\n grid-gap: 10px;\n }\n article {\n height: 100px;\n border: 1px solid black;\n }\n </style>\n </head>\n <body>\n \t<section>\n <article>1</article>\n <article>2</article>\n <article>3</article>\n <article>4</article>\n <article>5</article>\n <article>6</article>\n <article>7</article>\n <article>8</article>\n <article>9</article>\n </section>\n </body>\n</html>","libs":[]}
HTML/CSS/JavaScript 解法, 执行用时: 1751ms, 内存消耗: 77900KB, 提交时间: 2022-02-22
{"css":"","js":"","html":"<!DOCTYPE html>\n<html>\n <head>\n <meta charset=utf-8>\n <style type=\"text/css\">\n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n section {\n width: 500px;\n display:grid;\n grid-template-rows:100px;\n grid-template-columns:repeat(2,1fr);\n grid-gap::10px;\n text-align: center;\n }\n article {\n height: 100px;\n border: 1px solid black;\n }\n </style>\n </head>\n <body>\n \t<section>\n <article>1</article>\n <article>2</article>\n <article>3</article>\n <article>4</article>\n <article>5</article>\n <article>6</article>\n <article>7</article>\n <article>8</article>\n <article>9</article>\n </section>\n </body>\n</html>","libs":[]}
HTML/CSS/JavaScript 解法, 执行用时: 1754ms, 内存消耗: 77772KB, 提交时间: 2022-02-22
{"css":"","js":"","html":"<!DOCTYPE html>\n<html>\n <head>\n <meta charset=utf-8>\n <style type=\"text/css\">\n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n section {\n width: 500px;\n text-align: center;\n display: grid;\n \n grid-template-columns: repeat(2, 1fr);\n grid-gap:10px;\n }\n article {\n height: 100px;\n border: 1px solid black;\n }\n </style>\n </head>\n <body>\n \t<section>\n <article>1</article>\n <article>2</article>\n <article>3</article>\n <article>4</article>\n <article>5</article>\n <article>6</article>\n <article>7</article>\n <article>8</article>\n <article>9</article>\n </section>\n </body>\n</html>","libs":[]}
HTML/CSS/JavaScript 解法, 执行用时: 1754ms, 内存消耗: 77772KB, 提交时间: 2021-12-27
{"css":"","js":"","html":"<!DOCTYPE html>\n<html>\n <head>\n <meta charset=utf-8>\n <style type=\"text/css\">\n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n section {\n width: 500px;\n text-align: center;\n display: grid;\n grid-template-rows: 100px;\n grid-template-columns: repeat(2, 1fr);\n grid-gap: 10px;\n }\n article {\n height: 100px;\n border: 1px solid black;\n }\n </style>\n </head>\n <body>\n \t<section>\n <article>1</article>\n <article>2</article>\n <article>3</article>\n <article>4</article>\n <article>5</article>\n <article>6</article>\n <article>7</article>\n <article>8</article>\n <article>9</article>\n </section>\n </body>\n</html>","libs":[]}