<?xml version="1.0" encoding="utf-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>个人资源学习小站</title><link>https://www.ziyuanxitong.xyz/</link><description></description><item><title>网站建设之 CSS 布局技术详解</title><link>https://www.ziyuanxitong.xyz/?id=3</link><description>&lt;h1 class=&quot;header-vfC6AV auto-hide-last-sibling-br&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: var(--md-box-samantha-h1-font-size); margin-top: var(--md-box-samantha-h1-margin-top); margin-right: 0px; margin-left: 0px; line-height: var(--md-box-samantha-h1-line-height); font-family: Montserrat; overflow-anchor: auto; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); margin-bottom: var(--md-box-samantha-h1-margin-bottom) !important; padding-bottom: 0px !important;&quot;&gt;&lt;span style=&quot;color: var(--md-box-samantha-normal-text-color); font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;在网站建设过程中，CSS 布局技术是至关重要的一环，它直接影响着网站的视觉效果和用户体验。合理的 CSS 布局能够使网页结构清晰、美观，让用户在浏览时更加顺畅和舒适。&lt;/span&gt;&lt;/h1&gt;&lt;h2 class=&quot;header-vfC6AV auto-hide-last-sibling-br&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); padding-bottom: 0.3em; line-height: var(--md-box-samantha-h2-line-height); margin-top: var(--md-box-samantha-h2-margin-top); font-size: var(--md-box-samantha-h2-font-size); overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); margin-bottom: var(--md-box-samantha-h2-margin-bottom) !important;&quot;&gt;一、CSS 布局概述&lt;/h2&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;CSS（层叠样式表）主要用于描述网页的表现和格式化，而布局则是利用 CSS 将网页中的各种元素，如文本、图片、按钮等，进行合理的排列和定位，以形成一个完整、美观且易用的页面结构。随着互联网的发展，用户对网页的要求越来越高，不仅需要丰富的内容，还期望有良好的视觉感受和便捷的操作体验，这就使得 CSS 布局技术显得尤为重要。&lt;/div&gt;&lt;h2 class=&quot;header-vfC6AV auto-hide-last-sibling-br&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); padding-bottom: 0.3em; line-height: var(--md-box-samantha-h2-line-height); margin-top: var(--md-box-samantha-h2-margin-top); font-size: var(--md-box-samantha-h2-font-size); overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); margin-bottom: var(--md-box-samantha-h2-margin-bottom) !important;&quot;&gt;二、CSS 布局基础 —— 盒模型&lt;/h2&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;CSS 中的盒模型是布局的基础概念之一。每个网页元素都可以看作是一个矩形盒子，它由内容区域（Content）、内边距区域（Padding）、边框区域（Border）和外边距区域（Margin）组成。&lt;/div&gt;&lt;ul class=&quot;auto-hide-last-sibling-br list-paddingleft-2&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); padding-left: 20px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); margin-bottom: var(--md-box-samantha-li-margin) !important; margin-top: var(--md-box-samantha-li-margin) !important;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; font-weight: 600; color: var(--md-box-samantha-deep-text-color) !important; font-size: var(--md-box-samantha-normal-text-font-size); line-height: var(--md-box-samantha-normal-text-line-height); overflow-anchor: auto;&quot;&gt;内容区域&lt;/span&gt;：是元素的核心部分，用于存放实际的文本、图片等内容。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; font-weight: 600; color: var(--md-box-samantha-deep-text-color) !important; font-size: var(--md-box-samantha-normal-text-font-size); line-height: var(--md-box-samantha-normal-text-line-height); overflow-anchor: auto;&quot;&gt;内边距区域&lt;/span&gt;：位于内容区域周围，起到分隔内容与边框的作用，可以通过设置内边距来增加元素内部的空白空间。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; font-weight: 600; color: var(--md-box-samantha-deep-text-color) !important; font-size: var(--md-box-samantha-normal-text-font-size); line-height: var(--md-box-samantha-normal-text-line-height); overflow-anchor: auto;&quot;&gt;边框区域&lt;/span&gt;：围绕在内边距之外，可设置其样式（如实线、虚线等）、宽度和颜色，用于界定元素的边界。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; font-weight: 600; color: var(--md-box-samantha-deep-text-color) !important; font-size: var(--md-box-samantha-normal-text-font-size); line-height: var(--md-box-samantha-normal-text-line-height); overflow-anchor: auto;&quot;&gt;外边距区域&lt;/span&gt;：在边框之外，用于控制元素与其他元素之间的间隔。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;例如，以下代码定义了一个简单的盒模型：&lt;/div&gt;&lt;div class=&quot;relative w-fit custom-code-block-canvas-wrapper w-full&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; width: 600px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;code-block-element-YDlfvc light custom-code-block-container--css hide-indicator disable-theme-style custom-code-block-container&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); display: flex; flex-direction: column; position: relative; --code-area-radius: 6px; --code-area-radius-inner: calc(var(--code-area-radius) - 1px); --code-area-bg-color: var(--chat-md-codeblock-bg-color,#f9fafb); --code-header-bg-color: var(--chat-md-codeblock-header-bg-color,#f3f4f6); --code-mask-bg-color: linear-gradient(180deg,rgba(249,250,251,0),#f9fafb); --code-header-icon-color: rgba(0,0,0,.5); --code-header-text-color: rgba(0,0,0,.85); --code-header-icon-bg-color: rgba(0,0,0,.06); --code-block-code-color: #000000d9; --code-block-std-bg-color: #f3f4f6; --code-block-std-err-color: #d60000; margin-top: 8px; overflow-anchor: auto;&quot;&gt;&lt;div class=&quot;code-area-tZtDgG code-area&quot; dir=&quot;ltr&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--code-area-bg-color); border-radius: var(--code-area-radius); display: flex; flex-direction: column; height: fit-content; width: 600px; overflow-anchor: auto;&quot;&gt;&lt;div class=&quot;header-wrapper-UnnlXS&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; background-color: var(--chat-bg-color,#fff); position: sticky; top: 0px;&quot;&gt;&lt;div class=&quot;header-cGu84a&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; background: var(--code-header-bg-color); display: flex; flex-direction: row; flex-shrink: 0; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; height: 32px; justify-content: space-between; padding: 6px 9px 6px 6px; border-top-color: ; border-top-style: ; border-top-width: ; border-right-color: ; border-right-style: ; border-right-width: ; border-bottom-color: ; border-bottom-style: ; border-bottom-width: 0px; border-left-color: ; border-left-style: ; border-left-width: ; border-image-source: ; border-image-slice: ; border-image-width: ; border-image-outset: ; border-image-repeat: ; border-radius: var(--code-area-radius-inner) var(--code-area-radius-inner) 0 0; overflow-anchor: auto;&quot;&gt;&lt;div class=&quot;title-XQhI4x clickable-eGISjP&quot; tabindex=&quot;0&quot; aria-describedby=&quot;vesq5gq&quot; data-popupid=&quot;vesq5gq&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; border-radius: 4px; color: var(--code-header-icon-color); display: flex; flex-direction: row; gap: 3px; padding: 0px 4px 0px 10px; cursor: pointer;&quot;&gt;&lt;div class=&quot;text-jgT4jF&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; color: var(--code-header-text-color); display: flex; font-family: &amp;quot;PingFang SC&amp;quot;; font-size: 14px; gap: 3px; line-height: 22px; overflow: hidden; text-overflow: ellipsis; text-wrap-mode: nowrap;&quot;&gt;css&lt;/div&gt;&lt;div class=&quot;icon-FIfuuc&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 15px;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-12&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; d=&quot;M21.707 17.293a1 1 0 0 1-1.414 0L12 9l-8.293 8.293a1 1 0 0 1-1.414-1.414l8.293-8.293a2 2 0 0 1 2.828 0l8.293 8.293a1 1 0 0 1 0 1.414&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;action-tEcs3i&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; color: var(--code-header-icon-color); cursor: pointer; display: flex; flex-direction: row; gap: 8px; justify-content: space-between;&quot;&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; data-testid=&quot;code-block-copy&quot; tabindex=&quot;0&quot; aria-describedby=&quot;0wbag21&quot; data-popupid=&quot;0wbag21&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; fill-rule=&quot;evenodd&quot; d=&quot;M21 3.5V17a2 2 0 0 1-2 2h-2v-2h2V3.5H9v2h5.857c1.184 0 2.143.895 2.143 2v13c0 1.105-.96 2-2.143 2H5.143C3.959 22.5 3 21.605 3 20.5v-13c0-1.105.96-2 2.143-2H7v-2a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2m-6.143 4H5.143v13h9.714z&quot; clip-rule=&quot;evenodd&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; tabindex=&quot;0&quot; aria-describedby=&quot;mb7fnjf&quot; data-popupid=&quot;mb7fnjf&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; fill-rule=&quot;evenodd&quot; d=&quot;M4 4a1 1 0 0 1 1 1v3a3 3 0 0 0 3 3h11.086l-5.293-5.293a1 1 0 0 1 1.414-1.414l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L19.086 13H8a5 5 0 0 1-5-5V5a1 1 0 0 1 1-1&quot; clip-rule=&quot;evenodd&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; tabindex=&quot;0&quot; aria-describedby=&quot;cp8sgts&quot; data-popupid=&quot;cp8sgts&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; fill-rule=&quot;evenodd&quot; d=&quot;M4.797 16.856a8.28 8.28 0 0 0 6.27 2.87h.008A8.28 8.28 0 0 0 14.372 3.84a11.6 11.6 0 0 1-1.658 7.714 11.62 11.62 0 0 1-7.917 5.303M13.415 1.43a10.28 10.28 0 0 1-2.348 20.296 10.28 10.28 0 0 1-8.883-5.103c-.397-.74.155-1.605.912-1.609a9.617 9.617 0 0 0 9.011-12.258 1.093 1.093 0 0 1 1.308-1.326&quot; clip-rule=&quot;evenodd&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; tabindex=&quot;0&quot; aria-describedby=&quot;oy45he9&quot; data-popupid=&quot;oy45he9&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; d=&quot;M22 3v7a1 1 0 1 1-2 0V4h-6a1 1 0 1 1 0-2h7a1 1 0 0 1 1 1M11.005 21a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-7a1 1 0 0 1 2.002 0v6h6.003a1 1 0 0 1 1 1&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;content-EGRozu code-content light-scrollbar-TbsSwi&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--code-area-bg-color); flex-shrink: 0; height: fit-content; overflow: overlay; padding: 12px 16px 16px; overflow-anchor: auto; border-color: var(--s-color-border-tertiary); border-radius: 0 0 var(--code-area-radius-inner) var(--code-area-radius-inner); border-style: solid; border-width: 0px 1px 1px;&quot;&gt;&lt;pre class=&quot;container-_HmLba language-css&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-family: ui-monospace, SFMono-Regular, &amp;quot;SF Mono&amp;quot;, Menlo, Consolas, &amp;quot;Liberation Mono&amp;quot;, monospace; overflow-wrap: normal; --code-text_v3: #000000d9; --code-doc_v3: #00000073; --code-Link_v3: #2f74ff; --code-number_v3: #e54595; --code-keycontrol_v3: #9952e1; --code-function_v3: #ff5d4d; --code-variable_v3: #000000d9; --code-parameter_v3: #4da621; --code-attributes_v3: #c70; --code-selection-bg-color: #ebf1ff; background: var(--color-bg-page); word-break: normal; word-spacing: normal; hyphens: none; line-height: 1.5; tab-size: 4; margin-top: 0px; margin-bottom: 0px; overflow: auto; font-size: 13.6px; border-radius: 6px; padding: 0px; overflow-anchor: auto; width: fit-content;&quot;&gt;.box&amp;nbsp;-&amp;nbsp;model&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;width:&amp;nbsp;200px;&amp;nbsp;/*&amp;nbsp;内容区域宽度&amp;nbsp;*/
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;padding:&amp;nbsp;10px;&amp;nbsp;/*&amp;nbsp;内边距&amp;nbsp;*/
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;border:&amp;nbsp;2px&amp;nbsp;solid&amp;nbsp;black;&amp;nbsp;/*&amp;nbsp;边框&amp;nbsp;*/
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;margin:&amp;nbsp;20px;&amp;nbsp;/*&amp;nbsp;外边距&amp;nbsp;*/}&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;mask-wrapper-VgpgeU&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; opacity: 0; transition: opacity 0.15s;&quot;&gt;&lt;div class=&quot;mask-ZLHDuN&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--code-mask-bg-color); bottom: 0px; height: 56px; pointer-events: none; position: absolute; width: 600px; overflow-anchor: auto;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;br class=&quot;container-utlnW2 wrapper-d0Cc1k undefined&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); content: &amp;quot;&amp;quot;; display: block; font-size: var(--md-box-paragraph-spacing); margin: 1em; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;/&gt;&lt;/p&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;盒模型的理解和正确应用是进行 CSS 布局的关键，通过合理设置这四个部分的属性，可以精确控制每个元素在页面中的大小和位置。&lt;/div&gt;&lt;h2 class=&quot;header-vfC6AV auto-hide-last-sibling-br&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); padding-bottom: 0.3em; line-height: var(--md-box-samantha-h2-line-height); margin-top: var(--md-box-samantha-h2-margin-top); font-size: var(--md-box-samantha-h2-font-size); overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); margin-bottom: var(--md-box-samantha-h2-margin-bottom) !important;&quot;&gt;三、常见 CSS 布局方式&lt;/h2&gt;&lt;h3 class=&quot;header-vfC6AV auto-hide-last-sibling-br&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-h3-line-height); margin-top: var(--md-box-samantha-h3-margin-top); font-size: var(--md-box-samantha-h3-font-size); overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); margin-bottom: var(--md-box-samantha-h3-margin-bottom) !important; padding-bottom: 0px !important;&quot;&gt;（一）表格布局&lt;/h3&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;表格布局曾是网页布局的常用方式之一。它通过&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;&amp;lt;table&amp;gt;&lt;/code&gt;标签创建表格，将网页元素放置在表格的单元格中，从而实现布局效果。&lt;/div&gt;&lt;ul class=&quot;auto-hide-last-sibling-br list-paddingleft-2&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); padding-left: 20px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); margin-bottom: var(--md-box-samantha-li-margin) !important; margin-top: var(--md-box-samantha-li-margin) !important;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; font-weight: 600; color: var(--md-box-samantha-deep-text-color) !important; font-size: var(--md-box-samantha-normal-text-font-size); line-height: var(--md-box-samantha-normal-text-line-height); overflow-anchor: auto;&quot;&gt;优点&lt;/span&gt;：实现方式较为简单，各个元素在独立的单元格中，相互影响较小，对浏览器的兼容性也较好。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; font-weight: 600; color: var(--md-box-samantha-deep-text-color) !important; font-size: var(--md-box-samantha-normal-text-font-size); line-height: var(--md-box-samantha-normal-text-line-height); overflow-anchor: auto;&quot;&gt;缺点&lt;/span&gt;：在某些浏览器下，如 IE，表格需要全部下载完成后才会显示，当数据量较大时会严重影响网页的浏览速度。而且搜索引擎难以分析复杂的表格，网页样式改版也比较麻烦，多重表格嵌套还会使代码可读性变差。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;因此，除了一些规模较小、对布局要求不高的网站外，现在一般较少采用表格布局。&lt;/div&gt;&lt;h3 class=&quot;header-vfC6AV auto-hide-last-sibling-br&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-h3-line-height); margin-top: var(--md-box-samantha-h3-margin-top); font-size: var(--md-box-samantha-h3-font-size); overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); margin-bottom: var(--md-box-samantha-h3-margin-bottom) !important; padding-bottom: 0px !important;&quot;&gt;（二）框架布局&lt;/h3&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;框架布局是利用框架对页面空间进行划分，每个框架可以显示不同的网页内容，且各个框架之间相互独立。&lt;/div&gt;&lt;ul class=&quot;auto-hide-last-sibling-br list-paddingleft-2&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); padding-left: 20px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); margin-bottom: var(--md-box-samantha-li-margin) !important; margin-top: var(--md-box-samantha-li-margin) !important;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; font-weight: 600; color: var(--md-box-samantha-deep-text-color) !important; font-size: var(--md-box-samantha-normal-text-font-size); line-height: var(--md-box-samantha-normal-text-line-height); overflow-anchor: auto;&quot;&gt;优点&lt;/span&gt;：能使网页看起来更整洁、清晰，在某些情况下，部分框架内容可以缓存，有助于提高网页的下载速度。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; font-weight: 600; color: var(--md-box-samantha-deep-text-color) !important; font-size: var(--md-box-samantha-normal-text-font-size); line-height: var(--md-box-samantha-normal-text-line-height); overflow-anchor: auto;&quot;&gt;缺点&lt;/span&gt;：过多使用框架会影响网页的整体加载速度，且框架与浏览器的兼容性存在问题，保存页面时也比较麻烦，应用范围相对较窄。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;框架布局通常也仅适用于一些特定的小型网站或特定功能页面。&lt;/div&gt;&lt;h3 class=&quot;header-vfC6AV auto-hide-last-sibling-br&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-h3-line-height); margin-top: var(--md-box-samantha-h3-margin-top); font-size: var(--md-box-samantha-h3-font-size); overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); margin-bottom: var(--md-box-samantha-h3-margin-bottom) !important; padding-bottom: 0px !important;&quot;&gt;（三）DIV+CSS 布局&lt;/h3&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;DIV+CSS 布局是目前主流的网页布局方式。&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;&amp;lt;div&amp;gt;&lt;/code&gt;标签是一种块级元素，通过对&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;&amp;lt;div&amp;gt;&lt;/code&gt;元素进行合理嵌套，并结合 CSS 样式设置，可以实现各种复杂的布局效果。&lt;/div&gt;&lt;ul class=&quot;auto-hide-last-sibling-br list-paddingleft-2&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); padding-left: 20px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); margin-bottom: var(--md-box-samantha-li-margin) !important; margin-top: var(--md-box-samantha-li-margin) !important;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; font-weight: 600; color: var(--md-box-samantha-deep-text-color) !important; font-size: var(--md-box-samantha-normal-text-font-size); line-height: var(--md-box-samantha-normal-text-line-height); overflow-anchor: auto;&quot;&gt;优点&lt;/span&gt;：内容和表现相分离，便于代码的维护和管理；对搜索引擎更加友好，有利于网站的 SEO 优化；文件代码相对精简，执行速度更快。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; font-weight: 600; color: var(--md-box-samantha-deep-text-color) !important; font-size: var(--md-box-samantha-normal-text-font-size); line-height: var(--md-box-samantha-normal-text-line-height); overflow-anchor: auto;&quot;&gt;缺点&lt;/span&gt;：需要开发者对 CSS 有较深入的理解，布局过程中可能会遇到一些兼容性问题，需要进行细致的调试。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 class=&quot;header-vfC6AV auto-hide-last-sibling-br&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); padding-bottom: 0.3em; line-height: var(--md-box-samantha-h2-line-height); margin-top: var(--md-box-samantha-h2-margin-top); font-size: var(--md-box-samantha-h2-font-size); overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); margin-bottom: var(--md-box-samantha-h2-margin-bottom) !important;&quot;&gt;四、CSS 布局技术进阶&lt;/h2&gt;&lt;h3 class=&quot;header-vfC6AV auto-hide-last-sibling-br&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-h3-line-height); margin-top: var(--md-box-samantha-h3-margin-top); font-size: var(--md-box-samantha-h3-font-size); overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); margin-bottom: var(--md-box-samantha-h3-margin-bottom) !important; padding-bottom: 0px !important;&quot;&gt;（一）浮动布局（Floats）&lt;/h3&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;浮动布局通过&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;float&lt;/code&gt;属性来实现。常见的取值有&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;left&lt;/code&gt;（向左浮动）、&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;right&lt;/code&gt;（向右浮动）和&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;none&lt;/code&gt;（不浮动，默认值）。使用浮动属性可以使元素脱离正常文档流，实现文本环绕图片等效果，也常用于创建多列布局。&lt;/div&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;例如，以下代码可以创建一个简单的两列浮动布局：&lt;/div&gt;&lt;div class=&quot;relative w-fit custom-code-block-canvas-wrapper w-full&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; width: 600px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;code-block-element-YDlfvc light custom-code-block-container--css hide-indicator disable-theme-style custom-code-block-container&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); display: flex; flex-direction: column; position: relative; --code-area-radius: 6px; --code-area-radius-inner: calc(var(--code-area-radius) - 1px); --code-area-bg-color: var(--chat-md-codeblock-bg-color,#f9fafb); --code-header-bg-color: var(--chat-md-codeblock-header-bg-color,#f3f4f6); --code-mask-bg-color: linear-gradient(180deg,rgba(249,250,251,0),#f9fafb); --code-header-icon-color: rgba(0,0,0,.5); --code-header-text-color: rgba(0,0,0,.85); --code-header-icon-bg-color: rgba(0,0,0,.06); --code-block-code-color: #000000d9; --code-block-std-bg-color: #f3f4f6; --code-block-std-err-color: #d60000; margin-top: 8px; overflow-anchor: auto;&quot;&gt;&lt;div class=&quot;code-area-tZtDgG code-area&quot; dir=&quot;ltr&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--code-area-bg-color); border-radius: var(--code-area-radius); display: flex; flex-direction: column; height: fit-content; width: 600px; overflow-anchor: auto;&quot;&gt;&lt;div class=&quot;header-wrapper-UnnlXS&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; background-color: var(--chat-bg-color,#fff); position: sticky; top: 0px;&quot;&gt;&lt;div class=&quot;header-cGu84a&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; background: var(--code-header-bg-color); display: flex; flex-direction: row; flex-shrink: 0; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; height: 32px; justify-content: space-between; padding: 6px 9px 6px 6px; border-top-color: ; border-top-style: ; border-top-width: ; border-right-color: ; border-right-style: ; border-right-width: ; border-bottom-color: ; border-bottom-style: ; border-bottom-width: 0px; border-left-color: ; border-left-style: ; border-left-width: ; border-image-source: ; border-image-slice: ; border-image-width: ; border-image-outset: ; border-image-repeat: ; border-radius: var(--code-area-radius-inner) var(--code-area-radius-inner) 0 0; overflow-anchor: auto;&quot;&gt;&lt;div class=&quot;title-XQhI4x clickable-eGISjP&quot; tabindex=&quot;0&quot; aria-describedby=&quot;mh4i2uk&quot; data-popupid=&quot;mh4i2uk&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; border-radius: 4px; color: var(--code-header-icon-color); display: flex; flex-direction: row; gap: 3px; padding: 0px 4px 0px 10px; cursor: pointer;&quot;&gt;&lt;div class=&quot;text-jgT4jF&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; color: var(--code-header-text-color); display: flex; font-family: &amp;quot;PingFang SC&amp;quot;; font-size: 14px; gap: 3px; line-height: 22px; overflow: hidden; text-overflow: ellipsis; text-wrap-mode: nowrap;&quot;&gt;css&lt;/div&gt;&lt;div class=&quot;icon-FIfuuc&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 15px;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-12&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; d=&quot;M21.707 17.293a1 1 0 0 1-1.414 0L12 9l-8.293 8.293a1 1 0 0 1-1.414-1.414l8.293-8.293a2 2 0 0 1 2.828 0l8.293 8.293a1 1 0 0 1 0 1.414&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;action-tEcs3i&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; color: var(--code-header-icon-color); cursor: pointer; display: flex; flex-direction: row; gap: 8px; justify-content: space-between;&quot;&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; data-testid=&quot;code-block-copy&quot; tabindex=&quot;0&quot; aria-describedby=&quot;xanvigg&quot; data-popupid=&quot;xanvigg&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; fill-rule=&quot;evenodd&quot; d=&quot;M21 3.5V17a2 2 0 0 1-2 2h-2v-2h2V3.5H9v2h5.857c1.184 0 2.143.895 2.143 2v13c0 1.105-.96 2-2.143 2H5.143C3.959 22.5 3 21.605 3 20.5v-13c0-1.105.96-2 2.143-2H7v-2a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2m-6.143 4H5.143v13h9.714z&quot; clip-rule=&quot;evenodd&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; tabindex=&quot;0&quot; aria-describedby=&quot;hrrix01&quot; data-popupid=&quot;hrrix01&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; fill-rule=&quot;evenodd&quot; d=&quot;M4 4a1 1 0 0 1 1 1v3a3 3 0 0 0 3 3h11.086l-5.293-5.293a1 1 0 0 1 1.414-1.414l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L19.086 13H8a5 5 0 0 1-5-5V5a1 1 0 0 1 1-1&quot; clip-rule=&quot;evenodd&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; tabindex=&quot;0&quot; aria-describedby=&quot;9jqrx9r&quot; data-popupid=&quot;9jqrx9r&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; fill-rule=&quot;evenodd&quot; d=&quot;M4.797 16.856a8.28 8.28 0 0 0 6.27 2.87h.008A8.28 8.28 0 0 0 14.372 3.84a11.6 11.6 0 0 1-1.658 7.714 11.62 11.62 0 0 1-7.917 5.303M13.415 1.43a10.28 10.28 0 0 1-2.348 20.296 10.28 10.28 0 0 1-8.883-5.103c-.397-.74.155-1.605.912-1.609a9.617 9.617 0 0 0 9.011-12.258 1.093 1.093 0 0 1 1.308-1.326&quot; clip-rule=&quot;evenodd&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; tabindex=&quot;0&quot; aria-describedby=&quot;rmnckct&quot; data-popupid=&quot;rmnckct&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; d=&quot;M22 3v7a1 1 0 1 1-2 0V4h-6a1 1 0 1 1 0-2h7a1 1 0 0 1 1 1M11.005 21a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-7a1 1 0 0 1 2.002 0v6h6.003a1 1 0 0 1 1 1&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;content-EGRozu code-content light-scrollbar-TbsSwi&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--code-area-bg-color); flex-shrink: 0; height: fit-content; overflow: overlay; padding: 12px 16px 16px; overflow-anchor: auto; border-color: var(--s-color-border-tertiary); border-radius: 0 0 var(--code-area-radius-inner) var(--code-area-radius-inner); border-style: solid; border-width: 0px 1px 1px;&quot;&gt;&lt;pre class=&quot;container-_HmLba language-css&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-family: ui-monospace, SFMono-Regular, &amp;quot;SF Mono&amp;quot;, Menlo, Consolas, &amp;quot;Liberation Mono&amp;quot;, monospace; overflow-wrap: normal; --code-text_v3: #000000d9; --code-doc_v3: #00000073; --code-Link_v3: #2f74ff; --code-number_v3: #e54595; --code-keycontrol_v3: #9952e1; --code-function_v3: #ff5d4d; --code-variable_v3: #000000d9; --code-parameter_v3: #4da621; --code-attributes_v3: #c70; --code-selection-bg-color: #ebf1ff; background: var(--color-bg-page); word-break: normal; word-spacing: normal; hyphens: none; line-height: 1.5; tab-size: 4; margin-top: 0px; margin-bottom: 0px; overflow: auto; font-size: 13.6px; border-radius: 6px; padding: 0px; overflow-anchor: auto; width: fit-content;&quot;&gt;.float&amp;nbsp;-&amp;nbsp;left&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;float:&amp;nbsp;left;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;width:&amp;nbsp;50%;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;padding:&amp;nbsp;20px;}&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;mask-wrapper-VgpgeU&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; opacity: 0; transition: opacity 0.15s;&quot;&gt;&lt;div class=&quot;mask-ZLHDuN&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--code-mask-bg-color); bottom: 0px; height: 56px; pointer-events: none; position: absolute; width: 600px; overflow-anchor: auto;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;br class=&quot;container-utlnW2 wrapper-d0Cc1k undefined&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); content: &amp;quot;&amp;quot;; display: block; font-size: var(--md-box-paragraph-spacing); margin: 1em; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;/&gt;&lt;/p&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;但浮动布局容易产生 “高度塌陷” 问题，即当父元素内的子元素都设置了浮动，父元素会无法自动适应子元素的高度，导致其高度为 0。解决方法通常是给父元素添加&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;overflow: hidden&lt;/code&gt;属性，或者使用 clearfix 技巧等。&lt;/div&gt;&lt;h3 class=&quot;header-vfC6AV auto-hide-last-sibling-br&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-h3-line-height); margin-top: var(--md-box-samantha-h3-margin-top); font-size: var(--md-box-samantha-h3-font-size); overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); margin-bottom: var(--md-box-samantha-h3-margin-bottom) !important; padding-bottom: 0px !important;&quot;&gt;（二）定位布局（Positioning）&lt;/h3&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;定位布局允许开发者精确控制元素在页面上的位置。通过&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;position&lt;/code&gt;属性来设置，其取值包括&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;static&lt;/code&gt;（静态定位）、&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;relative&lt;/code&gt;（相对定位）、&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;absolute&lt;/code&gt;（绝对定位）和&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;fixed&lt;/code&gt;（固定定位）。&lt;/div&gt;&lt;ul class=&quot;auto-hide-last-sibling-br list-paddingleft-2&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); padding-left: 20px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); margin-bottom: var(--md-box-samantha-li-margin) !important; margin-top: var(--md-box-samantha-li-margin) !important;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; font-weight: 600; color: var(--md-box-samantha-deep-text-color) !important; font-size: var(--md-box-samantha-normal-text-font-size); line-height: var(--md-box-samantha-normal-text-line-height); overflow-anchor: auto;&quot;&gt;静态定位&lt;/span&gt;：是元素的默认定位方式，元素按照在 HTML 文档流中的顺序正常排列，无法通过&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; color: var(--color-text-primary); font-size: 14px; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto;&quot;&gt;top&lt;/code&gt;、&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; color: var(--color-text-primary); font-size: 14px; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto;&quot;&gt;bottom&lt;/code&gt;、&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; color: var(--color-text-primary); font-size: 14px; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto;&quot;&gt;left&lt;/code&gt;、&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; color: var(--color-text-primary); font-size: 14px; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto;&quot;&gt;right&lt;/code&gt;等属性来改变位置。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; font-weight: 600; color: var(--md-box-samantha-deep-text-color) !important; font-size: var(--md-box-samantha-normal-text-font-size); line-height: var(--md-box-samantha-normal-text-line-height); overflow-anchor: auto;&quot;&gt;相对定位&lt;/span&gt;：相对于元素在文档流中的原来位置进行定位，可以通过位置偏移属性改变其位置，但元素仍占据原来的空间，可能会覆盖其他元素。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; font-weight: 600; color: var(--md-box-samantha-deep-text-color) !important; font-size: var(--md-box-samantha-normal-text-font-size); line-height: var(--md-box-samantha-normal-text-line-height); overflow-anchor: auto;&quot;&gt;绝对定位&lt;/span&gt;：脱离文档流，相对于最近的已定位（非静态定位）祖先元素进行定位，如果没有这样的祖先元素，则相对于&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; color: var(--color-text-primary); font-size: 14px; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto;&quot;&gt;body&lt;/code&gt;元素。绝对定位的元素不占据原来的空间，会影响其他元素的布局。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; font-weight: 600; color: var(--md-box-samantha-deep-text-color) !important; font-size: var(--md-box-samantha-normal-text-font-size); line-height: var(--md-box-samantha-normal-text-line-height); overflow-anchor: auto;&quot;&gt;固定定位&lt;/span&gt;：是绝对定位的一种特殊形式，以浏览器窗口为参照物，无论页面如何滚动，元素都会固定在浏览器窗口的指定位置。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;例如，以下代码展示了固定定位的应用：&lt;/div&gt;&lt;div class=&quot;relative w-fit custom-code-block-canvas-wrapper w-full&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; width: 600px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;code-block-element-YDlfvc light custom-code-block-container--css hide-indicator disable-theme-style custom-code-block-container&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); display: flex; flex-direction: column; position: relative; --code-area-radius: 6px; --code-area-radius-inner: calc(var(--code-area-radius) - 1px); --code-area-bg-color: var(--chat-md-codeblock-bg-color,#f9fafb); --code-header-bg-color: var(--chat-md-codeblock-header-bg-color,#f3f4f6); --code-mask-bg-color: linear-gradient(180deg,rgba(249,250,251,0),#f9fafb); --code-header-icon-color: rgba(0,0,0,.5); --code-header-text-color: rgba(0,0,0,.85); --code-header-icon-bg-color: rgba(0,0,0,.06); --code-block-code-color: #000000d9; --code-block-std-bg-color: #f3f4f6; --code-block-std-err-color: #d60000; margin-top: 8px; overflow-anchor: auto;&quot;&gt;&lt;div class=&quot;code-area-tZtDgG code-area&quot; dir=&quot;ltr&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--code-area-bg-color); border-radius: var(--code-area-radius); display: flex; flex-direction: column; height: fit-content; width: 600px; overflow-anchor: auto;&quot;&gt;&lt;div class=&quot;header-wrapper-UnnlXS&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; background-color: var(--chat-bg-color,#fff); position: sticky; top: 0px;&quot;&gt;&lt;div class=&quot;header-cGu84a&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; background: var(--code-header-bg-color); display: flex; flex-direction: row; flex-shrink: 0; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; height: 32px; justify-content: space-between; padding: 6px 9px 6px 6px; border-top-color: ; border-top-style: ; border-top-width: ; border-right-color: ; border-right-style: ; border-right-width: ; border-bottom-color: ; border-bottom-style: ; border-bottom-width: 0px; border-left-color: ; border-left-style: ; border-left-width: ; border-image-source: ; border-image-slice: ; border-image-width: ; border-image-outset: ; border-image-repeat: ; border-radius: var(--code-area-radius-inner) var(--code-area-radius-inner) 0 0; overflow-anchor: auto;&quot;&gt;&lt;div class=&quot;title-XQhI4x clickable-eGISjP&quot; tabindex=&quot;0&quot; aria-describedby=&quot;4la3ibz&quot; data-popupid=&quot;4la3ibz&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; border-radius: 4px; color: var(--code-header-icon-color); display: flex; flex-direction: row; gap: 3px; padding: 0px 4px 0px 10px; cursor: pointer;&quot;&gt;&lt;div class=&quot;text-jgT4jF&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; color: var(--code-header-text-color); display: flex; font-family: &amp;quot;PingFang SC&amp;quot;; font-size: 14px; gap: 3px; line-height: 22px; overflow: hidden; text-overflow: ellipsis; text-wrap-mode: nowrap;&quot;&gt;css&lt;/div&gt;&lt;div class=&quot;icon-FIfuuc&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 15px;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-12&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; d=&quot;M21.707 17.293a1 1 0 0 1-1.414 0L12 9l-8.293 8.293a1 1 0 0 1-1.414-1.414l8.293-8.293a2 2 0 0 1 2.828 0l8.293 8.293a1 1 0 0 1 0 1.414&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;action-tEcs3i&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; color: var(--code-header-icon-color); cursor: pointer; display: flex; flex-direction: row; gap: 8px; justify-content: space-between;&quot;&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; data-testid=&quot;code-block-copy&quot; tabindex=&quot;0&quot; aria-describedby=&quot;a8j7wh9&quot; data-popupid=&quot;a8j7wh9&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; fill-rule=&quot;evenodd&quot; d=&quot;M21 3.5V17a2 2 0 0 1-2 2h-2v-2h2V3.5H9v2h5.857c1.184 0 2.143.895 2.143 2v13c0 1.105-.96 2-2.143 2H5.143C3.959 22.5 3 21.605 3 20.5v-13c0-1.105.96-2 2.143-2H7v-2a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2m-6.143 4H5.143v13h9.714z&quot; clip-rule=&quot;evenodd&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; tabindex=&quot;0&quot; aria-describedby=&quot;l9e8p4a&quot; data-popupid=&quot;l9e8p4a&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; fill-rule=&quot;evenodd&quot; d=&quot;M4 4a1 1 0 0 1 1 1v3a3 3 0 0 0 3 3h11.086l-5.293-5.293a1 1 0 0 1 1.414-1.414l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L19.086 13H8a5 5 0 0 1-5-5V5a1 1 0 0 1 1-1&quot; clip-rule=&quot;evenodd&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; tabindex=&quot;0&quot; aria-describedby=&quot;rjtbrm3&quot; data-popupid=&quot;rjtbrm3&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; fill-rule=&quot;evenodd&quot; d=&quot;M4.797 16.856a8.28 8.28 0 0 0 6.27 2.87h.008A8.28 8.28 0 0 0 14.372 3.84a11.6 11.6 0 0 1-1.658 7.714 11.62 11.62 0 0 1-7.917 5.303M13.415 1.43a10.28 10.28 0 0 1-2.348 20.296 10.28 10.28 0 0 1-8.883-5.103c-.397-.74.155-1.605.912-1.609a9.617 9.617 0 0 0 9.011-12.258 1.093 1.093 0 0 1 1.308-1.326&quot; clip-rule=&quot;evenodd&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; tabindex=&quot;0&quot; aria-describedby=&quot;bi81s5b&quot; data-popupid=&quot;bi81s5b&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; d=&quot;M22 3v7a1 1 0 1 1-2 0V4h-6a1 1 0 1 1 0-2h7a1 1 0 0 1 1 1M11.005 21a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-7a1 1 0 0 1 2.002 0v6h6.003a1 1 0 0 1 1 1&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;content-EGRozu code-content light-scrollbar-TbsSwi&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--code-area-bg-color); flex-shrink: 0; height: fit-content; overflow: overlay; padding: 12px 16px 16px; overflow-anchor: auto; border-color: var(--s-color-border-tertiary); border-radius: 0 0 var(--code-area-radius-inner) var(--code-area-radius-inner); border-style: solid; border-width: 0px 1px 1px;&quot;&gt;&lt;pre class=&quot;container-_HmLba language-css&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-family: ui-monospace, SFMono-Regular, &amp;quot;SF Mono&amp;quot;, Menlo, Consolas, &amp;quot;Liberation Mono&amp;quot;, monospace; overflow-wrap: normal; --code-text_v3: #000000d9; --code-doc_v3: #00000073; --code-Link_v3: #2f74ff; --code-number_v3: #e54595; --code-keycontrol_v3: #9952e1; --code-function_v3: #ff5d4d; --code-variable_v3: #000000d9; --code-parameter_v3: #4da621; --code-attributes_v3: #c70; --code-selection-bg-color: #ebf1ff; background: var(--color-bg-page); word-break: normal; word-spacing: normal; hyphens: none; line-height: 1.5; tab-size: 4; margin-top: 0px; margin-bottom: 0px; overflow: auto; font-size: 13.6px; border-radius: 6px; padding: 0px; overflow-anchor: auto; width: fit-content;&quot;&gt;.fixed&amp;nbsp;-&amp;nbsp;position&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;position:&amp;nbsp;fixed;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;top:&amp;nbsp;0;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;left:&amp;nbsp;0;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;width:&amp;nbsp;100%;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;background&amp;nbsp;-&amp;nbsp;color:&amp;nbsp;#ddd;}&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;mask-wrapper-VgpgeU&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; opacity: 0; transition: opacity 0.15s;&quot;&gt;&lt;div class=&quot;mask-ZLHDuN&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--code-mask-bg-color); bottom: 0px; height: 56px; pointer-events: none; position: absolute; width: 600px; overflow-anchor: auto;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3 class=&quot;header-vfC6AV auto-hide-last-sibling-br&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-h3-line-height); margin-top: var(--md-box-samantha-h3-margin-top); font-size: var(--md-box-samantha-h3-font-size); overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); margin-bottom: var(--md-box-samantha-h3-margin-bottom) !important; padding-bottom: 0px !important;&quot;&gt;（三）弹性盒模型（Flexbox）&lt;/h3&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;弹性盒模型是 CSS3 引入的一种新的布局模式，它提供了一种更灵活、更高效的方式来布局网页元素。通过将父元素设置为&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;display: flex&lt;/code&gt;，可以让子元素自动适应空间，轻松实现水平或垂直居中、等间距排列等效果。&lt;/div&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;例如，以下代码可以使子元素在父容器中水平居中：&lt;/div&gt;&lt;div class=&quot;relative w-fit custom-code-block-canvas-wrapper w-full&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; width: 600px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;code-block-element-YDlfvc light custom-code-block-container--css hide-indicator disable-theme-style custom-code-block-container&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); display: flex; flex-direction: column; position: relative; --code-area-radius: 6px; --code-area-radius-inner: calc(var(--code-area-radius) - 1px); --code-area-bg-color: var(--chat-md-codeblock-bg-color,#f9fafb); --code-header-bg-color: var(--chat-md-codeblock-header-bg-color,#f3f4f6); --code-mask-bg-color: linear-gradient(180deg,rgba(249,250,251,0),#f9fafb); --code-header-icon-color: rgba(0,0,0,.5); --code-header-text-color: rgba(0,0,0,.85); --code-header-icon-bg-color: rgba(0,0,0,.06); --code-block-code-color: #000000d9; --code-block-std-bg-color: #f3f4f6; --code-block-std-err-color: #d60000; margin-top: 8px; overflow-anchor: auto;&quot;&gt;&lt;div class=&quot;code-area-tZtDgG code-area&quot; dir=&quot;ltr&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--code-area-bg-color); border-radius: var(--code-area-radius); display: flex; flex-direction: column; height: fit-content; width: 600px; overflow-anchor: auto;&quot;&gt;&lt;div class=&quot;header-wrapper-UnnlXS&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; background-color: var(--chat-bg-color,#fff); position: sticky; top: 0px;&quot;&gt;&lt;div class=&quot;header-cGu84a&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; background: var(--code-header-bg-color); display: flex; flex-direction: row; flex-shrink: 0; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; height: 32px; justify-content: space-between; padding: 6px 9px 6px 6px; border-top-color: ; border-top-style: ; border-top-width: ; border-right-color: ; border-right-style: ; border-right-width: ; border-bottom-color: ; border-bottom-style: ; border-bottom-width: 0px; border-left-color: ; border-left-style: ; border-left-width: ; border-image-source: ; border-image-slice: ; border-image-width: ; border-image-outset: ; border-image-repeat: ; border-radius: var(--code-area-radius-inner) var(--code-area-radius-inner) 0 0; overflow-anchor: auto;&quot;&gt;&lt;div class=&quot;title-XQhI4x clickable-eGISjP&quot; tabindex=&quot;0&quot; aria-describedby=&quot;gptc25b&quot; data-popupid=&quot;gptc25b&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; border-radius: 4px; color: var(--code-header-icon-color); display: flex; flex-direction: row; gap: 3px; padding: 0px 4px 0px 10px; cursor: pointer;&quot;&gt;&lt;div class=&quot;text-jgT4jF&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; color: var(--code-header-text-color); display: flex; font-family: &amp;quot;PingFang SC&amp;quot;; font-size: 14px; gap: 3px; line-height: 22px; overflow: hidden; text-overflow: ellipsis; text-wrap-mode: nowrap;&quot;&gt;css&lt;/div&gt;&lt;div class=&quot;icon-FIfuuc&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 15px;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-12&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; d=&quot;M21.707 17.293a1 1 0 0 1-1.414 0L12 9l-8.293 8.293a1 1 0 0 1-1.414-1.414l8.293-8.293a2 2 0 0 1 2.828 0l8.293 8.293a1 1 0 0 1 0 1.414&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;action-tEcs3i&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; color: var(--code-header-icon-color); cursor: pointer; display: flex; flex-direction: row; gap: 8px; justify-content: space-between;&quot;&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; data-testid=&quot;code-block-copy&quot; tabindex=&quot;0&quot; aria-describedby=&quot;hu3xx2f&quot; data-popupid=&quot;hu3xx2f&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; fill-rule=&quot;evenodd&quot; d=&quot;M21 3.5V17a2 2 0 0 1-2 2h-2v-2h2V3.5H9v2h5.857c1.184 0 2.143.895 2.143 2v13c0 1.105-.96 2-2.143 2H5.143C3.959 22.5 3 21.605 3 20.5v-13c0-1.105.96-2 2.143-2H7v-2a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2m-6.143 4H5.143v13h9.714z&quot; clip-rule=&quot;evenodd&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; tabindex=&quot;0&quot; aria-describedby=&quot;byt4722&quot; data-popupid=&quot;byt4722&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; fill-rule=&quot;evenodd&quot; d=&quot;M4 4a1 1 0 0 1 1 1v3a3 3 0 0 0 3 3h11.086l-5.293-5.293a1 1 0 0 1 1.414-1.414l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L19.086 13H8a5 5 0 0 1-5-5V5a1 1 0 0 1 1-1&quot; clip-rule=&quot;evenodd&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; tabindex=&quot;0&quot; aria-describedby=&quot;aca3e8z&quot; data-popupid=&quot;aca3e8z&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; fill-rule=&quot;evenodd&quot; d=&quot;M4.797 16.856a8.28 8.28 0 0 0 6.27 2.87h.008A8.28 8.28 0 0 0 14.372 3.84a11.6 11.6 0 0 1-1.658 7.714 11.62 11.62 0 0 1-7.917 5.303M13.415 1.43a10.28 10.28 0 0 1-2.348 20.296 10.28 10.28 0 0 1-8.883-5.103c-.397-.74.155-1.605.912-1.609a9.617 9.617 0 0 0 9.011-12.258 1.093 1.093 0 0 1 1.308-1.326&quot; clip-rule=&quot;evenodd&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; tabindex=&quot;0&quot; aria-describedby=&quot;f0j93c9&quot; data-popupid=&quot;f0j93c9&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; d=&quot;M22 3v7a1 1 0 1 1-2 0V4h-6a1 1 0 1 1 0-2h7a1 1 0 0 1 1 1M11.005 21a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-7a1 1 0 0 1 2.002 0v6h6.003a1 1 0 0 1 1 1&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;content-EGRozu code-content light-scrollbar-TbsSwi&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--code-area-bg-color); flex-shrink: 0; height: fit-content; overflow: overlay; padding: 12px 16px 16px; overflow-anchor: auto; border-color: var(--s-color-border-tertiary); border-radius: 0 0 var(--code-area-radius-inner) var(--code-area-radius-inner); border-style: solid; border-width: 0px 1px 1px;&quot;&gt;&lt;pre class=&quot;container-_HmLba language-css&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-family: ui-monospace, SFMono-Regular, &amp;quot;SF Mono&amp;quot;, Menlo, Consolas, &amp;quot;Liberation Mono&amp;quot;, monospace; overflow-wrap: normal; --code-text_v3: #000000d9; --code-doc_v3: #00000073; --code-Link_v3: #2f74ff; --code-number_v3: #e54595; --code-keycontrol_v3: #9952e1; --code-function_v3: #ff5d4d; --code-variable_v3: #000000d9; --code-parameter_v3: #4da621; --code-attributes_v3: #c70; --code-selection-bg-color: #ebf1ff; background: var(--color-bg-page); word-break: normal; word-spacing: normal; hyphens: none; line-height: 1.5; tab-size: 4; margin-top: 0px; margin-bottom: 0px; overflow: auto; font-size: 13.6px; border-radius: 6px; padding: 0px; overflow-anchor: auto; width: fit-content;&quot;&gt;.flex&amp;nbsp;-&amp;nbsp;container&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;display:&amp;nbsp;flex;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;justify&amp;nbsp;-&amp;nbsp;content:&amp;nbsp;center;}&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;mask-wrapper-VgpgeU&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; opacity: 0; transition: opacity 0.15s;&quot;&gt;&lt;div class=&quot;mask-ZLHDuN&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--code-mask-bg-color); bottom: 0px; height: 56px; pointer-events: none; position: absolute; width: 600px; overflow-anchor: auto;&quot;&gt;&lt;br/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;justify - content&lt;/code&gt;属性用于控制子元素在主轴上的对齐方式，除了&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;center&lt;/code&gt;（居中）外，还有&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;flex - start&lt;/code&gt;（起点对齐）、&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;flex - end&lt;/code&gt;（终点对齐）、&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;space - between&lt;/code&gt;（两端对齐，中间间距相等）等取值。&lt;/div&gt;&lt;h3 class=&quot;header-vfC6AV auto-hide-last-sibling-br&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-h3-line-height); margin-top: var(--md-box-samantha-h3-margin-top); font-size: var(--md-box-samantha-h3-font-size); overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); margin-bottom: var(--md-box-samantha-h3-margin-bottom) !important; padding-bottom: 0px !important;&quot;&gt;（四）网格布局（CSS Grid）&lt;/h3&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;网格布局是一种更强大的二维布局系统，它将网页划分为行和列，通过定义网格容器和网格项，能够精确地控制元素在网格中的位置和大小。&lt;/div&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;例如，以下代码创建了一个简单的网格布局：&lt;/div&gt;&lt;div class=&quot;relative w-fit custom-code-block-canvas-wrapper w-full&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; width: 600px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;code-block-element-YDlfvc light custom-code-block-container--css hide-indicator disable-theme-style custom-code-block-container&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); display: flex; flex-direction: column; position: relative; --code-area-radius: 6px; --code-area-radius-inner: calc(var(--code-area-radius) - 1px); --code-area-bg-color: var(--chat-md-codeblock-bg-color,#f9fafb); --code-header-bg-color: var(--chat-md-codeblock-header-bg-color,#f3f4f6); --code-mask-bg-color: linear-gradient(180deg,rgba(249,250,251,0),#f9fafb); --code-header-icon-color: rgba(0,0,0,.5); --code-header-text-color: rgba(0,0,0,.85); --code-header-icon-bg-color: rgba(0,0,0,.06); --code-block-code-color: #000000d9; --code-block-std-bg-color: #f3f4f6; --code-block-std-err-color: #d60000; margin-top: 8px; overflow-anchor: auto;&quot;&gt;&lt;div class=&quot;code-area-tZtDgG code-area&quot; dir=&quot;ltr&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--code-area-bg-color); border-radius: var(--code-area-radius); display: flex; flex-direction: column; height: fit-content; width: 600px; overflow-anchor: auto;&quot;&gt;&lt;div class=&quot;header-wrapper-UnnlXS&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; background-color: var(--chat-bg-color,#fff); position: sticky; top: 0px;&quot;&gt;&lt;div class=&quot;header-cGu84a&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; background: var(--code-header-bg-color); display: flex; flex-direction: row; flex-shrink: 0; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; height: 32px; justify-content: space-between; padding: 6px 9px 6px 6px; border-top-color: ; border-top-style: ; border-top-width: ; border-right-color: ; border-right-style: ; border-right-width: ; border-bottom-color: ; border-bottom-style: ; border-bottom-width: 0px; border-left-color: ; border-left-style: ; border-left-width: ; border-image-source: ; border-image-slice: ; border-image-width: ; border-image-outset: ; border-image-repeat: ; border-radius: var(--code-area-radius-inner) var(--code-area-radius-inner) 0 0; overflow-anchor: auto;&quot;&gt;&lt;div class=&quot;title-XQhI4x clickable-eGISjP&quot; tabindex=&quot;0&quot; aria-describedby=&quot;grqrn93&quot; data-popupid=&quot;grqrn93&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; border-radius: 4px; color: var(--code-header-icon-color); display: flex; flex-direction: row; gap: 3px; padding: 0px 4px 0px 10px; cursor: pointer;&quot;&gt;&lt;div class=&quot;text-jgT4jF&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; color: var(--code-header-text-color); display: flex; font-family: &amp;quot;PingFang SC&amp;quot;; font-size: 14px; gap: 3px; line-height: 22px; overflow: hidden; text-overflow: ellipsis; text-wrap-mode: nowrap;&quot;&gt;css&lt;/div&gt;&lt;div class=&quot;icon-FIfuuc&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 15px;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-12&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; d=&quot;M21.707 17.293a1 1 0 0 1-1.414 0L12 9l-8.293 8.293a1 1 0 0 1-1.414-1.414l8.293-8.293a2 2 0 0 1 2.828 0l8.293 8.293a1 1 0 0 1 0 1.414&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;action-tEcs3i&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; color: var(--code-header-icon-color); cursor: pointer; display: flex; flex-direction: row; gap: 8px; justify-content: space-between;&quot;&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; data-testid=&quot;code-block-copy&quot; tabindex=&quot;0&quot; aria-describedby=&quot;sk05m5d&quot; data-popupid=&quot;sk05m5d&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; fill-rule=&quot;evenodd&quot; d=&quot;M21 3.5V17a2 2 0 0 1-2 2h-2v-2h2V3.5H9v2h5.857c1.184 0 2.143.895 2.143 2v13c0 1.105-.96 2-2.143 2H5.143C3.959 22.5 3 21.605 3 20.5v-13c0-1.105.96-2 2.143-2H7v-2a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2m-6.143 4H5.143v13h9.714z&quot; clip-rule=&quot;evenodd&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; tabindex=&quot;0&quot; aria-describedby=&quot;g87wlxr&quot; data-popupid=&quot;g87wlxr&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; fill-rule=&quot;evenodd&quot; d=&quot;M4 4a1 1 0 0 1 1 1v3a3 3 0 0 0 3 3h11.086l-5.293-5.293a1 1 0 0 1 1.414-1.414l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L19.086 13H8a5 5 0 0 1-5-5V5a1 1 0 0 1 1-1&quot; clip-rule=&quot;evenodd&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; tabindex=&quot;0&quot; aria-describedby=&quot;mby56mb&quot; data-popupid=&quot;mby56mb&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; fill-rule=&quot;evenodd&quot; d=&quot;M4.797 16.856a8.28 8.28 0 0 0 6.27 2.87h.008A8.28 8.28 0 0 0 14.372 3.84a11.6 11.6 0 0 1-1.658 7.714 11.62 11.62 0 0 1-7.917 5.303M13.415 1.43a10.28 10.28 0 0 1-2.348 20.296 10.28 10.28 0 0 1-8.883-5.103c-.397-.74.155-1.605.912-1.609a9.617 9.617 0 0 0 9.011-12.258 1.093 1.093 0 0 1 1.308-1.326&quot; clip-rule=&quot;evenodd&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; tabindex=&quot;0&quot; aria-describedby=&quot;y3lt5dy&quot; data-popupid=&quot;y3lt5dy&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; d=&quot;M22 3v7a1 1 0 1 1-2 0V4h-6a1 1 0 1 1 0-2h7a1 1 0 0 1 1 1M11.005 21a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-7a1 1 0 0 1 2.002 0v6h6.003a1 1 0 0 1 1 1&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;content-EGRozu code-content light-scrollbar-TbsSwi&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--code-area-bg-color); flex-shrink: 0; height: fit-content; overflow: overlay; padding: 12px 16px 16px; overflow-anchor: auto; border-color: var(--s-color-border-tertiary); border-radius: 0 0 var(--code-area-radius-inner) var(--code-area-radius-inner); border-style: solid; border-width: 0px 1px 1px;&quot;&gt;&lt;pre class=&quot;container-_HmLba language-css&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-family: ui-monospace, SFMono-Regular, &amp;quot;SF Mono&amp;quot;, Menlo, Consolas, &amp;quot;Liberation Mono&amp;quot;, monospace; overflow-wrap: normal; --code-text_v3: #000000d9; --code-doc_v3: #00000073; --code-Link_v3: #2f74ff; --code-number_v3: #e54595; --code-keycontrol_v3: #9952e1; --code-function_v3: #ff5d4d; --code-variable_v3: #000000d9; --code-parameter_v3: #4da621; --code-attributes_v3: #c70; --code-selection-bg-color: #ebf1ff; background: var(--color-bg-page); word-break: normal; word-spacing: normal; hyphens: none; line-height: 1.5; tab-size: 4; margin-top: 0px; margin-bottom: 0px; overflow: auto; font-size: 13.6px; border-radius: 6px; padding: 0px; overflow-anchor: auto; width: fit-content;&quot;&gt;.grid&amp;nbsp;-&amp;nbsp;container&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;display:&amp;nbsp;grid;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;grid&amp;nbsp;-&amp;nbsp;template&amp;nbsp;-&amp;nbsp;columns:&amp;nbsp;repeat(3,&amp;nbsp;1fr);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;grid&amp;nbsp;-&amp;nbsp;template&amp;nbsp;-&amp;nbsp;rows:&amp;nbsp;auto;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;gap:&amp;nbsp;10px;}.grid&amp;nbsp;-&amp;nbsp;item&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;background&amp;nbsp;-&amp;nbsp;color:&amp;nbsp;lightblue;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;padding:&amp;nbsp;20px;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;text&amp;nbsp;-&amp;nbsp;align:&amp;nbsp;center;}&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;mask-wrapper-VgpgeU&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; opacity: 0; transition: opacity 0.15s;&quot;&gt;&lt;div class=&quot;mask-ZLHDuN&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--code-mask-bg-color); bottom: 0px; height: 56px; pointer-events: none; position: absolute; width: 600px; overflow-anchor: auto;&quot;&gt;&lt;br/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;上述代码中，&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;grid - template - columns&lt;/code&gt;定义了列的布局，&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;repeat(3, 1fr)&lt;/code&gt;表示创建 3 列，每列宽度相等；&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;grid - template - rows&lt;/code&gt;定义行的布局，&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;auto&lt;/code&gt;表示行高根据内容自动调整；&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--color-inline-code-background); border-radius: 4px; font-size: var(--md-box-samantha-normal-text-font-size); font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; overflow-anchor: auto; line-height: var(--md-box-samantha-normal-text-line-height); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;gap&lt;/code&gt;设置了网格项之间的间距。&lt;/div&gt;&lt;h2 class=&quot;header-vfC6AV auto-hide-last-sibling-br&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); padding-bottom: 0.3em; line-height: var(--md-box-samantha-h2-line-height); margin-top: var(--md-box-samantha-h2-margin-top); font-size: var(--md-box-samantha-h2-font-size); overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); margin-bottom: var(--md-box-samantha-h2-margin-bottom) !important;&quot;&gt;五、响应式布局中的 CSS 布局应用&lt;/h2&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;随着移动设备的普及，响应式布局变得越来越重要。响应式布局要求网站能够在不同屏幕尺寸和设备上都能保持良好的显示效果和可用性。CSS 中的媒体查询（Media Queries）是实现响应式布局的关键技术之一。&lt;/div&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;通过媒体查询，可以根据不同的屏幕宽度、高度、分辨率、设备方向等条件，为不同的设备应用不同的 CSS 样式。例如：&lt;/div&gt;&lt;div class=&quot;relative w-fit custom-code-block-canvas-wrapper w-full&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; width: 600px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;code-block-element-YDlfvc light custom-code-block-container--css hide-indicator disable-theme-style custom-code-block-container&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); display: flex; flex-direction: column; position: relative; --code-area-radius: 6px; --code-area-radius-inner: calc(var(--code-area-radius) - 1px); --code-area-bg-color: var(--chat-md-codeblock-bg-color,#f9fafb); --code-header-bg-color: var(--chat-md-codeblock-header-bg-color,#f3f4f6); --code-mask-bg-color: linear-gradient(180deg,rgba(249,250,251,0),#f9fafb); --code-header-icon-color: rgba(0,0,0,.5); --code-header-text-color: rgba(0,0,0,.85); --code-header-icon-bg-color: rgba(0,0,0,.06); --code-block-code-color: #000000d9; --code-block-std-bg-color: #f3f4f6; --code-block-std-err-color: #d60000; margin-top: 8px; overflow-anchor: auto;&quot;&gt;&lt;div class=&quot;code-area-tZtDgG code-area&quot; dir=&quot;ltr&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--code-area-bg-color); border-radius: var(--code-area-radius); display: flex; flex-direction: column; height: fit-content; width: 600px; overflow-anchor: auto;&quot;&gt;&lt;div class=&quot;header-wrapper-UnnlXS&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; background-color: var(--chat-bg-color,#fff); position: sticky; top: 0px;&quot;&gt;&lt;div class=&quot;header-cGu84a&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; background: var(--code-header-bg-color); display: flex; flex-direction: row; flex-shrink: 0; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; height: 32px; justify-content: space-between; padding: 6px 9px 6px 6px; border-top-color: ; border-top-style: ; border-top-width: ; border-right-color: ; border-right-style: ; border-right-width: ; border-bottom-color: ; border-bottom-style: ; border-bottom-width: 0px; border-left-color: ; border-left-style: ; border-left-width: ; border-image-source: ; border-image-slice: ; border-image-width: ; border-image-outset: ; border-image-repeat: ; border-radius: var(--code-area-radius-inner) var(--code-area-radius-inner) 0 0; overflow-anchor: auto;&quot;&gt;&lt;div class=&quot;title-XQhI4x clickable-eGISjP&quot; tabindex=&quot;0&quot; aria-describedby=&quot;ov5c3zn&quot; data-popupid=&quot;ov5c3zn&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; border-radius: 4px; color: var(--code-header-icon-color); display: flex; flex-direction: row; gap: 3px; padding: 0px 4px 0px 10px; cursor: pointer;&quot;&gt;&lt;div class=&quot;text-jgT4jF&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; color: var(--code-header-text-color); display: flex; font-family: &amp;quot;PingFang SC&amp;quot;; font-size: 14px; gap: 3px; line-height: 22px; overflow: hidden; text-overflow: ellipsis; text-wrap-mode: nowrap;&quot;&gt;css&lt;/div&gt;&lt;div class=&quot;icon-FIfuuc&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 15px;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-12&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; d=&quot;M21.707 17.293a1 1 0 0 1-1.414 0L12 9l-8.293 8.293a1 1 0 0 1-1.414-1.414l8.293-8.293a2 2 0 0 1 2.828 0l8.293 8.293a1 1 0 0 1 0 1.414&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;action-tEcs3i&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; align-items: center; color: var(--code-header-icon-color); cursor: pointer; display: flex; flex-direction: row; gap: 8px; justify-content: space-between;&quot;&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; data-testid=&quot;code-block-copy&quot; tabindex=&quot;0&quot; aria-describedby=&quot;9imdarp&quot; data-popupid=&quot;9imdarp&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; fill-rule=&quot;evenodd&quot; d=&quot;M21 3.5V17a2 2 0 0 1-2 2h-2v-2h2V3.5H9v2h5.857c1.184 0 2.143.895 2.143 2v13c0 1.105-.96 2-2.143 2H5.143C3.959 22.5 3 21.605 3 20.5v-13c0-1.105.96-2 2.143-2H7v-2a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2m-6.143 4H5.143v13h9.714z&quot; clip-rule=&quot;evenodd&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; tabindex=&quot;0&quot; aria-describedby=&quot;tio71wa&quot; data-popupid=&quot;tio71wa&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; fill-rule=&quot;evenodd&quot; d=&quot;M4 4a1 1 0 0 1 1 1v3a3 3 0 0 0 3 3h11.086l-5.293-5.293a1 1 0 0 1 1.414-1.414l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L19.086 13H8a5 5 0 0 1-5-5V5a1 1 0 0 1 1-1&quot; clip-rule=&quot;evenodd&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; tabindex=&quot;0&quot; aria-describedby=&quot;qrwralr&quot; data-popupid=&quot;qrwralr&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; fill-rule=&quot;evenodd&quot; d=&quot;M4.797 16.856a8.28 8.28 0 0 0 6.27 2.87h.008A8.28 8.28 0 0 0 14.372 3.84a11.6 11.6 0 0 1-1.658 7.714 11.62 11.62 0 0 1-7.917 5.303M13.415 1.43a10.28 10.28 0 0 1-2.348 20.296 10.28 10.28 0 0 1-8.883-5.103c-.397-.74.155-1.605.912-1.609a9.617 9.617 0 0 0 9.011-12.258 1.093 1.093 0 0 1 1.308-1.326&quot; clip-rule=&quot;evenodd&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hoverable-sPLxOT&quot; tabindex=&quot;0&quot; aria-describedby=&quot;px344pw&quot; data-popupid=&quot;px344pw&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: flex; height: 20px; justify-content: center; position: relative; width: 20px; overflow-anchor: auto;&quot;&gt;&lt;span role=&quot;img&quot; class=&quot;semi-icon semi-icon-default text-14&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; display: inline-block; line-height: 0; text-align: center; text-rendering: optimizelegibility; fill: currentcolor; font-size: 14px; overflow-anchor: auto;&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;none&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentColor&quot; d=&quot;M22 3v7a1 1 0 1 1-2 0V4h-6a1 1 0 1 1 0-2h7a1 1 0 0 1 1 1M11.005 21a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-7a1 1 0 0 1 2.002 0v6h6.003a1 1 0 0 1 1 1&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;content-EGRozu code-content light-scrollbar-TbsSwi&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--code-area-bg-color); flex-shrink: 0; height: fit-content; overflow: overlay; padding: 12px 16px 16px; overflow-anchor: auto; border-color: var(--s-color-border-tertiary); border-radius: 0 0 var(--code-area-radius-inner) var(--code-area-radius-inner); border-style: solid; border-width: 0px 1px 1px;&quot;&gt;&lt;pre class=&quot;container-_HmLba language-css&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-family: ui-monospace, SFMono-Regular, &amp;quot;SF Mono&amp;quot;, Menlo, Consolas, &amp;quot;Liberation Mono&amp;quot;, monospace; overflow-wrap: normal; --code-text_v3: #000000d9; --code-doc_v3: #00000073; --code-Link_v3: #2f74ff; --code-number_v3: #e54595; --code-keycontrol_v3: #9952e1; --code-function_v3: #ff5d4d; --code-variable_v3: #000000d9; --code-parameter_v3: #4da621; --code-attributes_v3: #c70; --code-selection-bg-color: #ebf1ff; background: var(--color-bg-page); word-break: normal; word-spacing: normal; hyphens: none; line-height: 1.5; tab-size: 4; margin-top: 0px; margin-bottom: 0px; overflow: auto; font-size: 13.6px; border-radius: 6px; padding: 0px; overflow-anchor: auto; width: fit-content;&quot;&gt;@media&amp;nbsp;(max&amp;nbsp;-&amp;nbsp;width:&amp;nbsp;768px)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;body&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;font&amp;nbsp;-&amp;nbsp;size:&amp;nbsp;16px;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;header&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;padding:&amp;nbsp;10px;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}}&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;mask-wrapper-VgpgeU&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-anchor: auto; opacity: 0; transition: opacity 0.15s;&quot;&gt;&lt;div class=&quot;mask-ZLHDuN&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: var(--code-mask-bg-color); bottom: 0px; height: 56px; pointer-events: none; position: absolute; width: 600px; overflow-anchor: auto;&quot;&gt;&lt;br/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;上述代码表示当屏幕宽度小于或等于 768 像素时，将网页字体大小设置为 16 像素，头部内边距调整为 10 像素。&lt;/div&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;此外，弹性盒模型和网格布局也在响应式布局中发挥着重要作用，它们可以根据容器大小自动调整子元素的布局，使网页在不同设备上都能呈现出合理的布局效果。&lt;/div&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: var(--md-box-samantha-normal-text-line-height); font-size: 16px; overflow-anchor: auto; font-family: Inter, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;SF Pro SC&amp;quot;, &amp;quot;SF Pro Display&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); color: var(--md-box-samantha-normal-text-color) !important;&quot;&gt;总之，CSS 布局技术是网站建设中不可或缺的部分，从基础的盒模型到各种布局方式，再到响应式布局的应用，每一个环节都需要开发者熟练掌握，才能创建出美观、易用、兼容各种设备的优秀网站。随着 CSS 技术的不断发展，未来还会有更多强大的布局功能出现，开发者需要不断学习和探索，以跟上时代的步伐，为用户带来更好的网页浏览体验。&lt;/div&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Mon, 07 Jul 2025 16:50:38 +0800</pubDate></item></channel></rss>