{"id":12118,"date":"2026-04-07T16:41:49","date_gmt":"2026-04-07T08:41:49","guid":{"rendered":"https:\/\/www.zhangxinxu.com\/wordpress\/?p=12118"},"modified":"2026-04-07T16:41:49","modified_gmt":"2026-04-07T08:41:49","slug":"css-pyramidal-grid","status":"publish","type":"post","link":"https:\/\/www.zhangxinxu.com\/wordpress\/2026\/04\/css-pyramidal-grid\/","title":{"rendered":"CSS\u516d\u8fb9\u5f62\u5934\u50cf\u7684\u5b9e\u73b0\u4e0e\u8702\u5de2\u5e03\u5c40"},"content":{"rendered":"<p>by <a href=\"https:\/\/www.zhangxinxu.com\/\">zhangxinxu<\/a> from <a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=12118\">https:\/\/www.zhangxinxu.com\/wordpress\/?p=12118<\/a><br \/>\n\u672c\u6587\u53ef\u5168\u6587\u8f6c\u8f7d\uff0c\u4f46\u9700\u8981\u4fdd\u7559\u539f\u4f5c\u8005\u3001\u51fa\u5904\u4ee5\u53ca\u6587\u4e2d\u94fe\u63a5\uff0cAI\u6293\u53d6\u4fdd\u7559\u539f\u6587\u5730\u5740\uff0c\u4efb\u4f55\u7f51\u7ad9\u5747\u53ef\u6458\u8981\u805a\u5408\uff0c\u5546\u7528\u8bf7\u8054\u7cfb\u6388\u6743\u3002<\/p>\n<p>\u672c\u6587\u5185\u5bb9\u5206\u4e3a\u4e24\u556a\uff0c\u4e00\u4e2a\u662f\u516d\u8fb9\u5f62\u5934\u50cf\u6548\u679c\u7684\u5b9e\u73b0\uff0c\u800c\u662f\u91d1\u5b57\u5854\u5e03\u5c40\uff08\u53c8\u79f0\u8702\u5de2\u5e03\u5c40\uff09\u7684\u5b9e\u73b0\u3002<\/p>\n<h3>\u4e00\u3001\u516d\u8fb9\u5f62\u5934\u50cf<\/h3>\n<p>\u4e0d\u5570\u55e6\uff0c\u76f4\u63a5\u770b\u4ee3\u7801\u548c\u6700\u7ec8\u5b9e\u73b0\u7684\u6548\u679c\uff0c\u540c\u6837\u7684\uff0c\u7528\u7684\u662fCSS <code>corner-shape<\/code>\u5c5e\u6027\u3002<\/p>\n<pre>img {\r\n  aspect-ratio: cos(30deg);\r\n  border-radius: 50% \/ 25%;\r\n  corner-shape: bevel;\r\n  width: 150px;\r\n  border: 1px solid #0001;\r\n  object-fit: cover;\r\n}<\/pre>\n<style>.hexagon {aspect-ratio: cos(30deg);border-radius: 50% \/ 25%;corner-shape: bevel;width: 150px;border: 1px solid #0001;object-fit: cover;}<\/style>\n<p>\u5b9e\u65f6\u6e32\u67d3\u6548\u679c\u5982\u4e0b\uff1a<\/p>\n<p><img decoding=\"async\" class=\"hexagon\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/hanyun.jpg\"\/><\/p>\n<p>\u5982\u679c\u4f60\u662f\u624b\u673a\u8bbf\u95ee\uff0c\u6216\u8005\u4e00\u4e9b\u5f88\u4e45\u6ca1\u5347\u7ea7\u7684\u56fd\u4ea7\u6d4f\u89c8\u5668\uff0c\u5e94\u5f53\u770b\u4e0d\u5230\u6548\u679c\uff0c\u53ef\u4ee5\u770b\u4e0b\u9762\u7684\u622a\u56fe\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202604\/2026-4-3_201148.jpeg\" width=\"168\" height=\"195\" alt=\"\u516d\u8fb9\u5f62\u5934\u50cf\u622a\u56fe\u6548\u679c\" class=\"alignnone size-medium\" \/><\/p>\n<p>\u516d\u8fb9\u5f62\u5934\u50cf\u7684CSS\u4ee3\u7801\u662f\u56fa\u5b9a\u7684\uff0c\u5927\u5bb6\u4f7f\u7528\u7684\u65f6\u5019\u76f4\u63a5\u590d\u5236\u7c98\u8d34\u5c31\u597d\u4e86\u3002<\/p>\n<h3>\u4e8c\u3001\u8702\u7a9d\u5e03\u5c40\u5b9e\u73b0\u65b9\u6cd5<\/h3>\n<p>\u516d\u8fb9\u5f62\u4e5f\u6b63\u597d\u662f\u8702\u5de2\u683c\u5b50\u7684\u5f62\u72b6\uff0c\u56e0\u6b64\uff0c\u975e\u5e38\u9002\u5408\u7528\u6765\u5b9e\u73b0\u91d1\u5b57\u5854\u4e00\u6837\u7684\u8702\u7a9d\u5e03\u5c40\u3002<\/p>\n<p>\u5b9e\u9645\u4e0a\uff0c\u8fd9\u79cd\u5e03\u5c40\u5728\u65e5\u5e38\u5f00\u53d1\u4e2d\u4e5f\u662f\u6bd4\u8f83\u5e38\u89c1\u7684\uff0c\u4f8b\u5982\u6211\u6700\u8fd1\u5f00\u53d1\u7684\u67d0\u4e2a\u9875\u9762\u5c31\u6709\u8fd9\u6837\u7684\u5e03\u5c40\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202604\/2026-4-7_102641.png\" width=\"232\" height=\"268\" alt=\"\u91d1\u5b57\u5854\u5e03\u5c40\u793a\u610f\" class=\"alignnone size-medium\" \/><\/p>\n<p>\u4e00\u822c\u7684\u5f00\u53d1\u4eba\u5458\u9047\u5230\u8fd9\u79cd\u72b6\u51b5\uff0c\u53ef\u80fd\u4f1a\u624b\u5de5\u786c\u6413\u6bcf\u4e2a\u5143\u7d20\u7684\u5b9a\u4f4d\uff0c\u4f8b\u5982\uff0c\u4f8b\u5982\u5339\u914d\u7b2c\u4e00\u9879\u5143\u7d20\uff0c\u8ba9\u5176\u7edd\u5bf9\u5b9a\u4f4d\u5c45\u4e2d\uff0c\u7b2c\u4e8c\u884c\u5143\u7d20\u4fdd\u6301Flex\u5e03\u5c40\u3002<\/p>\n<pre>.item:first-child {\r\n  \/* \u7b2c\u4e00\u884c\u7279\u6b8a\u5c45\u4e2d\u5904\u7406 *\/\r\n  position: absolute;\r\n}<\/pre>\n<p>\u5176\u5b9e\u53ef\u4ee5\u8bd5\u8bd5Flex\u5012\u5e8f\u6392\u7248\u3002<\/p>\n<h4>Flex\u5b9e\u73b0\u8702\u7a9d\u5e03\u5c40<\/h4>\n<p>\u5047\u8bbeHTML\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n<pre>&lt;div class=\"container\"&gt;\r\n  &lt;span&gt;1&lt;\/span&gt;\r\n  &lt;span&gt;2&lt;\/span&gt;\r\n  &lt;span&gt;3&lt;\/span&gt;\r\n&lt;\/div&gt;<\/pre>\n<p>\u5219\u53ef\u4ee5\u8bd5\u8bd5\u5982\u4e0b\u6240\u793a\u7684CSS\uff1a<\/p>\n<pre>.container {\r\n  --size: 40px;\r\n  --gap: 5px;\r\n  --offset: calc((2 * var(--size) + var(--gap)) \/ (-4 * cos(30deg)));\r\n\r\n  width: 240px;\r\n  display: flex;\r\n  flex-wrap: wrap-reverse;\r\n  direction: rtl;\r\n  justify-content: center;\r\n  gap: var(--gap);\r\n  padding-bottom: calc(-1 * var(--offset));\r\n}\r\n\r\n.container &gt; span {\r\n  aspect-ratio: cos(30deg);\r\n  border-radius: 50% \/ 25%;\r\n  corner-shape: bevel;\r\n  width: calc(var(--size) * 2);\r\n  margin-bottom: var(--offset);\r\n  \/* \u6392\u5e8f\u5012\u5e8f *\/\r\n  order: calc(-1 * sibling-index());\r\n  \/* \u63d0\u793a\u6587\u5b57\u5c45\u4e2d *\/\r\n  display: grid;\r\n  place-items: center;\r\n  background-color: deepskyblue;\r\n  color: #fff;\r\n}<\/pre>\n<p>\u6b64\u65f6\u7684\u6e32\u67d3\u6548\u679c\u5982\u4e0b\u622a\u56fe\u6240\u793a\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202604\/2026-4-7_155636.png\" width=\"249\" height=\"177\" alt=\"Flex\u5b9e\u73b0\u7684\u8702\u5de2\u5e03\u5c40\" class=\"alignnone size-medium\" \/><\/p>\n<p>\u4e0d\u8fc7Flex\u5012\u5e8f\u53ea\u9002\u5408\u4e09\u4e2a\u6570\u91cf\uff0c\u5982\u679c\u8d85\u8fc7\uff0c\u90a3\u4e48\u8fd9\u4e2a\u5e03\u5c40\u65b9\u6cd5\u5c31\u65e0\u6548\u4e86\u3002<\/p>\n<p>\u4e0b\u9762\u95ee\u9898\u6765\u4e86\uff0c\u6709\u6ca1\u6709\u4ec0\u4e48\u529e\u6cd5\uff0c\u65e0\u8bba\u5217\u8868\u6570\u91cf\u591a\u5c11\uff0c\u81ea\u52a8\u91d1\u5b57\u5854\u5e03\u5c40\u5462\uff1f<\/p>\n<h4>Grid\u5b9e\u73b0\u8702\u5de2\u5e03\u5c40<\/h4>\n<p>\u6709\uff0cGrid\u5e03\u5c40\u662f\u53ef\u4ee5\u5b9e\u73b0\u8fd9\u6837\u7684\u6548\u679c\u7684\u3002<\/p>\n<p>\u6211\u4eec\u5148\u4ece\u6700\u7b80\u5355\u4e09\u4e2a\u5217\u8868\u9879\u5f00\u59cb\u5b9e\u73b0\uff0c\u5047\u8bbeHTML\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre>&lt;div class=\"container\"&gt;\r\n  &lt;s&gt;&lt;\/s&gt;\r\n  &lt;s&gt;&lt;\/s&gt;\r\n  &lt;s&gt;&lt;\/s&gt;\r\n&lt;\/div&gt;<\/pre>\n<p>\u5982\u4e0bCSS\u4ee3\u7801\u5c31\u53ef\u4ee5\u6709\u8702\u7a9d\u5e03\u5c40\u6548\u679c\u4e86\uff1a<\/p>\n<pre>.container {\r\n  --size: 40px;\r\n  --gap: 5px;\r\n\r\n  width: 240px;\r\n  display: grid;\r\n  grid-template-columns: repeat(auto-fit, var(--size));\r\n  justify-content: center;\r\n  gap: var(--gap);\r\n  padding-bottom: calc((2 * var(--size) + var(--gap)) \/ (4 * cos(30deg)));\r\n  outline: 1px dotted;\r\n}\r\n\r\n.container &gt; s {\r\n  grid-column-end: span 2;\r\n  aspect-ratio: cos(30deg);\r\n  border-radius: 50% \/ 25%;\r\n  corner-shape: bevel;\r\n  \/* \u5782\u76f4\u65b9\u5411\u95f4\u9699\u548cgap\u4fdd\u6301\u4e00\u81f4 *\/\r\n  margin-bottom: calc((2 * var(--size) + var(--gap)) \/ (-4 * cos(30deg)));\r\n  background-color: deepskyblue;\r\n}\r\n\r\n.container &gt; :nth-child(1) {\r\n  grid-column-start: 3;\r\n}\r\n\r\n.container &gt; :nth-child(2) {\r\n  grid-column-start: 2;\r\n}<\/pre>\n<p>\u539f\u7406\u5f88\u7b80\u5355\uff0c\u53ea\u9700\u8981\u7cbe\u786e\u6307\u5b9a\u6bcf\u4e00\u884c\u7b2c\u4e00\u4e2a\u5143\u7d20\u7684<code>grid-column-start<\/code>\u503c\u5c31\u597d\u4e86\uff0c\u5728Grid\u5e03\u5c40\u4e2d\uff0c\u6bcf\u4e00\u884c\u540e\u9762\u7684\u5143\u7d20\u53ea\u4f1a\u81ea\u52a8\u8ddf\u968f\u6392\u5217\u7684\u3002<\/p>\n<p>\u5982\u679c\u662f\u4e09\u4e2a\u5217\u8868\u5143\u7d20\uff0c\u90a3\u4e48\u7b2c\u4e00\u884c\u7684\u9996\u5143\u7d20\u5e8f\u5217\u662f1\uff0c\u56e0\u6b64\u9009\u62e9\u5668\u662f<code>:nth-child(1)<\/code>\uff0c\u7b2c\u4e8c\u884c\u7684\u9996\u5143\u7d20\u5e8f\u5217\u662f2\uff0c\u56e0\u6b64\u9009\u62e9\u5668\u662f<code>:nth-child(2)<\/code>\uff0c\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u81ea\u52a8\u8ddf\u968f\uff0c\u65e0\u9700\u4e13\u95e8\u8bbe\u7f6e\u3002<\/p>\n<p>\u5b9e\u65f6\u6e32\u67d3\u6548\u679c\u5982\u4e0b\uff1a<\/p>\n<style>.container {--size: 40px;--gap: 5px;width: 240px;display: grid;grid-template-columns: repeat(auto-fit, var(--size));justify-content: center;gap: var(--gap);padding-bottom: calc((2 * var(--size) + var(--gap)) \/ (4 * cos(30deg)));outline: 1px dotted;}.container > s {grid-column-end: span 2;aspect-ratio: cos(30deg);border-radius: 50% \/ 25%;corner-shape: bevel;margin-bottom: calc((2 * var(--size) + var(--gap)) \/ (-4 * cos(30deg)));background-color: deepskyblue;}.container > :nth-child(1) {grid-column-start: 3;}.container > :nth-child(2) {grid-column-start: 2;}<\/style>\n<div class=\"container\"><s><\/s><s><\/s><s><\/s><\/div>\n<h4>\u4e0d\u9650\u6570\u91cf\u5168\u81ea\u52a8\u8702\u5de2\u5e03\u5c40<\/h4>\n<p>\u7531\u4e8eChrome\u6d4f\u89c8\u5668\u652f\u6301\u4e86<code>if<\/code>\u51fd\u6570\uff0c\u56e0\u6b64\uff0c\u7eafCSS\u5b9e\u73b0\u4e0d\u9650\u6570\u91cf\u5168\u81ea\u52a8\u8702\u5de2\u5e03\u5c40\u6210\u4e3a\u4e86\u53ef\u80fd\uff0c\u5177\u4f53\u5b9e\u73b0\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre>@property --_n {syntax: \"&lt;integer&gt;\";initial-value: 1;inherits: true}\r\n@property --_i {syntax: \"&lt;number&gt;\";initial-value: 1;inherits: true}\r\n@property --_j {syntax: \"&lt;number&gt;\";initial-value: 1;inherits: true}\r\n@property --_c {syntax: \"&lt;number&gt;\";initial-value: 1;inherits: true}\r\n@property --_d {syntax: \"&lt;number&gt;\";initial-value: 1;inherits: true}\r\n\r\n.container {\r\n  --s: 40px;  \/* \u5c3a\u5bf8\u5927\u5c0f  *\/\r\n  --g: 5px;   \/* \u95f4\u9699\u5927\u5c0f *\/\r\n  \r\n  display: grid;\r\n  grid-template-columns: repeat(auto-fit, var(--s) var(--s));\r\n  justify-content: center;\r\n  gap: var(--g);\r\n  padding-bottom: calc((2 * var(--s) + var(--g)) \/ (4 * cos(30deg)));\r\n  container-type: inline-size;\r\n}\r\n.container &gt; * {\r\n  grid-column-end: span 2;\r\n  aspect-ratio: cos(30deg);\r\n  border-radius: 50% \/ 25%;\r\n  corner-shape: bevel;\r\n  margin-bottom: calc((2 * var(--s) + var(--g)) \/ (-4 * cos(30deg)));\r\n  --_n: round(down, (100cqw + var(--g)) \/ (2 * (var(--s) + var(--g))));\r\n  --_i: calc((sibling-index() - 2 + (var(--_n) * (3 - var(--_n))) \/ 2) \/ (2 * var(--_n) - 1));\r\n  --_c: mod(var(--_i), 1);\r\n  --_j: calc(sqrt(2 * sibling-index() - 1.75) - .5);\r\n  --_d: mod(var(--_j), 1);\r\n  grid-column-start: \r\n    if(\r\n      style((--_i &gt;= 1) and (--_c: 0)): 2; \r\n      style(--_d: 0): max(0, var(--_n) - var(--_j));\r\n    );\r\n}<\/pre>\n<p>\u5148\u662f\u6839\u636e\u5bb9\u5668\u5c3a\u5bf8\u548c\u5143\u7d20\u5c3a\u5bf8\u8ba1\u7b97\u6bcf\u884c\u53ef\u4ee5\u663e\u793a\u7684\u6570\u91cf\uff0c\u7136\u540e\u6839\u636e\u53d6\u6a21\u7684\u503c\u662f\u4e0d\u662f\u6574\u6570\uff0c\u5224\u65ad\u662f\u4e0d\u662f\u6bcf\u4e00\u884c\u7684\u7b2c\u4e00\u9879\uff0c\u901a\u8fc7<code>if()<\/code>\u51fd\u6570\u8bbe\u7f6e\u7cbe\u51c6\u7684<code>grid-column-start<\/code>\u503c\u3002<\/p>\n<p>\u539f\u7406\u867d\u7136\u7b80\u5355\uff0c\u4f46\u662f\u5b9e\u73b0\u7ec6\u8282\u8fd8\u662f\u5f88\u590d\u6742\u7684\uff0c\u6bd4\u5982\u5927\u5bb6\u65e0\u9700\u6df1\u7a76\uff0c\u76f4\u63a5\u590d\u5236\u7c98\u8d34\u4ee3\u7801\u4f7f\u7528\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<p>\u53ea\u9700\u8981\u5c06\u5b50\u5143\u7d20\u6362\u6210\u56fe\u7247\u5143\u7d20\uff0c\u5c31\u53ef\u4ee5\u8f7b\u677e\u5b9e\u73b0\u4e0b\u56fe\u6240\u793a\u7684\u8702\u5de2\u5934\u50cf\u5e03\u5c40\u6548\u679c\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202604\/2026-4-7_114948.jpeg\" width=\"282\" height=\"266\" alt=\"\u8702\u7a9d\u5934\u50cf\u5e03\u5c40\u793a\u610f\" class=\"alignnone size-medium\" \/><\/p>\n<p>\u5177\u4f53\u4e0d\u5c55\u5f00\uff0c\u56e0\u4e3a\u53d7\u5236\u4e8e\u517c\u5bb9\u6027\u9650\u5236\uff0c\u76ee\u524d\u53ea\u80fd\u5b9e\u9a8c\u73af\u5883\u4f7f\u7528\u3002<\/p>\n<h3>\u4e09\u3001\u7ed3\u8bed\u8bf4\u660e<\/h3>\n<p>\u524d\u7aef\u4e09\u5251\u5ba2\u4e2d\uff0cCSS\u7684\u53d1\u5c55\u662f\u6700\u5feb\u7684\uff0c\u4f60\u770b\u6211\u5199\u7684\u65b0\u7279\u6027\u4ecb\u7ecd\u6587\u7ae0\uff0c\u5927\u591a\u6570\u90fd\u662fCSS\uff0c\u5e76\u4e0d\u662f\u6211\u523b\u610f\u6311\u9009\uff0c\u800c\u771fTM\u5c31\u662f\u5927\u591a\u6570\u524d\u7aef\u65b0\u7279\u6027\u90fd\u662fCSS\u3002<\/p>\n<p>\u8003\u8651\u5230CSS\u7684\u5b66\u4e60\u70ed\u6f6e\u65e9\u5c31\u6c89\u5bc2\u591a\u5e74\u3002<\/p>\n<p>\u6211\u89c9\u5f97CSS\u8fd9\u95e8\u8bed\u8a00\u79bb\u65ad\u5c42\u4e0d\u8fdc\u4e86\uff0c\u53ea\u8981\u51e0\u5e74\u4e0d\u5173\u6ce8\uff0c\u6211\u8ddf\u5927\u5bb6\u8bb2\uff0c\u90a3\u4e9b\u524d\u6cbf\u7684CSS\u4ee3\u7801\uff0c\u7edd\u5bf9\u662f\u770b\u4e0d\u61c2\u7684\u3002<\/p>\n<p>\u5404\u79cd\u65b0\u51fd\u6570\u3001\u5c5e\u6027\u8fd8\u6709\u8bed\u6cd5\u7cd6\u5c42\u51fa\u4e0d\u7a77\uff0c\u5c31\u597d\u6bd4\u672c\u6587\u8fd9\u4e2a\u91d1\u5b57\u5854\u8702\u5de2\u5e03\u5c40\u4e2d\u7684CSS\u5b9e\u73b0\u7ec6\u8282\uff0c\u6211\u4f30\u8ba19\u6210\u4ee5\u4e0a\u7684\u524d\u7aef\u662f\u770b\u4e0d\u61c2\u4ec0\u4e48\u610f\u601d\u7684\u3002<\/p>\n<p>\u5176\u4e2d\u51fa\u73b0\u7684\u8fd9\u4e9b\u7279\u6027\uff0c\u6211\u4e4b\u524d\u90fd\u6709\u4ecb\u7ecd\uff1a<\/p>\n<ol>\n<li><code>corner-shape<\/code>\u89c1\u6b64\u6587\uff1a<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/2025\/08\/css-corner-shape\/\">\u5927\u5f00\u773c\u754c\u7684CSS corner-shape\u5c5e\u6027<\/a><\/li>\n<li><code>aspect-ratio<\/code>\u89c1\u6b64\u6587\uff1a<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/2021\/02\/css-aspect-ratio\/\">Chrome 88\u5df2\u7ecf\u652f\u6301aspect-ratio\u5c5e\u6027\u4e86\uff0c\u5b66\u8d77\u6765<\/a><\/li>\n<li><code>round()<\/code>\u3001<code>mod()<\/code>\u7b49\u6570\u5b66\u51fd\u6570\uff1a<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/2024\/09\/css-math-round-function\/\">Chrome\u4e5f\u652f\u6301round\u7b49CSS\u6570\u5b66\u51fd\u6570\u4e86<\/a><\/li>\n<li><code>cos()<\/code>\u4e09\u89d2\u51fd\u6570\u89c1\uff1a<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/2023\/06\/css-sin-cos-tan-function\/\">CSS sin()\/cos()\u7b49\u6570\u5b66\u4e09\u89d2\u51fd\u6570\u7b80\u4ecb\u4e0e\u5e94\u7528<\/a><\/li>\n<li><code>sibling-index()<\/code>\u7d22\u5f15\u5e8f\u53f7\u51fd\u6570\u4ecb\u7ecd\u51fa\u5904\uff1a<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/2025\/08\/css-sibling-index-count\/\">CSS\u7d22\u5f15\u548c\u6570\u91cf\u5339\u914d\u51fd\u6570sibling-index sibling-count\u7b80\u4ecb<\/a><\/li>\n<li><code>if()<\/code>\u51fd\u6570\u4ecb\u7ecd\uff1a<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/2025\/07\/css-if-function\/\">CSS\u5012\u53cd\u5929\u7f61\u5c45\u7136\u652f\u6301if()\u51fd\u6570\u4e86<\/a><\/li>\n<li><code>container-type<\/code>\u548c<code>100cqw<\/code>\u5c5e\u4e8e\u5bb9\u5668\u67e5\u8be2\u91cc\u9762\u7684\u77e5\u8bc6\uff1a<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/2022\/09\/css-container-rule\/\">2022\u5e74\u6700\u671f\u5f85\u7684CSS container\u5bb9\u5668\u67e5\u8be2<\/a><\/li>\n<\/ol>\n<p>\u6240\u4ee5\u8fd8\u662f\u90a3\u53e5\u8bdd\uff0c\u5b66\u4e60\u662f\u4e0d\u80fd\u505c\u6b62\u7684\uff0c\u65f6\u4ee3\u53d8\u5316\u5f88\u5feb\uff0c\u8981\u662f\u5b89\u4e8e\u73b0\u72b6\uff0c\u8bf4\u4e0d\u5b9a\u5c31\u4f1a\u6389\u961f\u3002<\/p>\n<p>\u53c2\u8003\u6587\u7ae0\uff1a<a href=\"https:\/\/css-tricks.com\/making-a-responsive-pyramidal-grid-with-modern-css\/\" rel=\"noopener\" target=\"_blank\">\u54cd\u5e94\u5f0f\u91d1\u5b57\u5854\u7f51\u683c<\/a><\/p>\n<p>\ud83d\ude09\ud83d\ude0a\ud83d\ude07<br \/>\n\ud83e\udd70\ud83d\ude0d\ud83d\ude18<\/p>\n<p>\u672c\u6587\u4e3a\u539f\u521b\u6587\u7ae0\uff0c\u4f1a\u7ecf\u5e38\u66f4\u65b0\u77e5\u8bc6\u70b9\u4ee5\u53ca\u4fee\u6b63\u4e00\u4e9b\u9519\u8bef\uff0c\u56e0\u6b64\u8f6c\u8f7d\u8bf7\u4fdd\u7559\u539f\u51fa\u5904\uff0c\u65b9\u4fbf\u6eaf\u6e90\uff0c\u907f\u514d\u9648\u65e7\u9519\u8bef\u77e5\u8bc6\u7684\u8bef\u5bfc\uff0c\u540c\u65f6\u6709\u66f4\u597d\u7684\u9605\u8bfb\u4f53\u9a8c\u3002<br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=12118\">https:\/\/www.zhangxinxu.com\/wordpress\/?p=12118<\/a><\/p>\n<p>\uff08\u672c\u7bc7\u5b8c\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202604\/2026-4-7_162049.jpeg\" width=\"160\" height=\"100\" alt=\"\u8702\u5de2\u5e03\u5c40\u5934\u50cf\" class=\"alignright size-medium\" loading=\"lazy\" \/><\/p>\n<p>\u5982\u9898\uff0c\u4ecb\u7ecd\u516d\u8fb9\u5f62\u5934\u50cf\u7684CSS\u5b9e\u73b0\u6280\u5de7\uff0c\u4ee5\u53ca\u5982\u4f55\u57fa\u4e8e\u8fd9\u4e2a\u516d\u8fb9\u5f62\u5b9e\u73b0\u9ad8\u5927\u4e0a\u7684\u8702\u5de2\u5e03\u5c40\u6548\u679c\uff0c\u53c8\u662f\u5c55\u73b0CSS\u6f5c\u529b\u7684\u4e00\u5929\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[1926,1862,2078,1045,1515,1347,1537,2093,2074],"_links":{"self":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/12118"}],"collection":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/comments?post=12118"}],"version-history":[{"count":7,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/12118\/revisions"}],"predecessor-version":[{"id":12175,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/12118\/revisions\/12175"}],"wp:attachment":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/media?parent=12118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/categories?post=12118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/tags?post=12118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}