{"id":28153,"date":"2024-11-24T09:17:21","date_gmt":"2024-11-24T01:17:21","guid":{"rendered":"https:\/\/fwq.ai\/blog\/28153\/"},"modified":"2024-11-24T09:17:21","modified_gmt":"2024-11-24T01:17:21","slug":"%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0%e7%88%b6%e5%85%83%e7%b4%a0%e4%b8%ad%e5%ad%90%e5%85%83%e7%b4%a0%e4%b8%a4%e8%a1%8c%e6%8e%92%e5%88%97%e5%b9%b6%e6%8f%90%e4%be%9b%e7%9c%81%e7%95%a5%e5%8f%b7%e5%b1%95","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/28153\/","title":{"rendered":"\u5982\u4f55\u5b9e\u73b0\u7236\u5143\u7d20\u4e2d\u5b50\u5143\u7d20\u4e24\u884c\u6392\u5217\u5e76\u63d0\u4f9b\u7701\u7565\u53f7\u5c55\u5f00\u529f\u80fd\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173141227529209.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u5b9e\u73b0\u7236\u5143\u7d20\u4e2d\u5b50\u5143\u7d20\u4e24\u884c\u6392\u5217\u5e76\u63d0\u4f9b\u7701\u7565\u53f7\u5c55\u5f00\u529f\u80fd\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u5b9e\u73b0\u7236\u5143\u7d20\u4e2d\u5b50\u5143\u7d20\u4e24\u884c\u6392\u5217\u5e76\u63d0\u4f9b\u7701\u7565\u53f7\u5c55\u5f00\u529f\u80fd\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5728\u7236\u5143\u7d20\u4e2d\u5b9e\u73b0\u5b50\u5143\u7d20\u4e24\u884c\uff0c\u5e76\u63d0\u4f9b\u7701\u7565\u53f7\u5c55\u5f00\u529f\u80fd<\/strong><\/p>\n<p>\u8981\u5b9e\u73b0\u6b64\u6548\u679c\uff0c\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<p><strong>HTML\uff1a<\/strong><\/p>\n<pre>&lt;div id=\"container\"&gt;\n  &lt;div id=\"flex-container\"&gt;\n    &lt;div class=\"item\"&gt;item1&lt;\/div&gt;\n    ...\n  &lt;\/div&gt;\n  &lt;div id=\"more\"&gt;...&lt;\/div&gt;\n&lt;\/div&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>CSS\uff1a<\/strong><\/p>\n<pre>#container {\n  width: 400px;\n  height: 200px;\n  border: 1px solid red;\n}\n\n#flex-container {\n  width: 800px;\n  height: 200px;\n  background: pink;\n  display: flex;\n  flex-wrap: wrap;\n}\n\n#more {\n  display: none;\n  position: absolute;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>JavaScript\uff1a<\/strong><\/p>\n<pre>document.getElementById(\"more\").onclick = function() {\n  this.style.display = \"none\";\n  document.getElementById(\"container\").className = \"scroll\";\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u57fa\u672c\u539f\u7406\uff1a<\/strong><\/p>\n<ul>\n<li>\u5728\u7236\u5143\u7d20 #contner \u5185\u521b\u5efa\u4e00\u4e2a #flex-container\uff0c\u7528\u4e8e\u5bb9\u7eb3\u5b50\u5143\u7d20\u3002<\/li>\n<li>#container \u7684\u5bbd\u5ea6\u548c\u9ad8\u5ea6\u8bbe\u5b9a\u4e3a\u56fa\u5b9a\u503c\uff0c\u8d85\u51fa\u90e8\u5206\u81ea\u52a8\u9690\u85cf\u3002<\/li>\n<li>#flex-container \u4f7f\u7528 flex \u5e03\u5c40\uff0c\u4f7f\u5176\u5b50\u5143\u7d20\u81ea\u52a8\u6362\u884c\u6392\u5217\u3002<\/li>\n<li>#more \u662f\u4e00\u4e2a\u7701\u7565\u53f7\u6309\u94ae\uff0c\u521d\u59cb\u65f6\u9690\u85cf\u3002<\/li>\n<li>\u70b9\u51fb #more\uff0c\u89e6\u53d1 #more \u9690\u85cf\uff0c\u5e76\u89e3\u9664 #container \u7684\u8d85\u51fa\u9690\u85cf\u9650\u5236\uff0c\u663e\u793a\u6240\u6709\u5b50\u5143\u7d20\u5e76\u51fa\u73b0\u6a2a\u5411\u6eda\u52a8\u6761\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u5b9e\u73b0\u7236\u5143\u7d20\u4e2d\u5b50\u5143\u7d20\u4e24\u884c\u5e76\u63d0\u4f9b\u7701\u7565\u53f7\u5c55\u5f00\u529f\u80fd\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u7236\u5143\u7d20\u4e2d\u5b9e\u73b0\u5b50\u5143\u7d20\u4e24\u884c\uff0c\u5e76\u63d0\u4f9b\u7701\u7565\u53f7\u5c55\u5f00\u529f\u80fd \u8981\u5b9e\u73b0\u6b64\u6548\u679c\uff0c\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u6b65\u9aa4\uff1a HTML\uff1a &lt;div id=&#8221;container&#8221;&gt; &lt;div id=&#8221;flex-container&#8221;&gt; &lt;div class=&#8221;item&#8221;&gt;item1&lt;\/div&gt; &#8230; &lt;\/div&gt; &lt;div id=&#8221;more&#8221;&gt;&#8230;&lt;\/div&gt; &lt;\/div&gt; \u767b\u5f55\u540e\u590d\u5236 CSS\uff1a #container { width: 400px; height: 200px; border: 1px solid red; } #flex-container { width: 800px; height: 200px; background: pink; display: flex; flex-wrap: wrap; } #more { display: none; position: absolute; } \u767b\u5f55\u540e\u590d\u5236 JavaScript\uff1a document.getElementById(&#8220;more&#8221;).onclick = function() { this.style.display = [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-28153","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=28153"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28153\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=28153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=28153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=28153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}