{"id":1600,"date":"2021-12-23T23:58:31","date_gmt":"2021-12-23T15:58:31","guid":{"rendered":"https:\/\/www.strongd.net\/?p=1600"},"modified":"2021-12-23T23:58:31","modified_gmt":"2021-12-23T15:58:31","slug":"%e9%83%bd2021%e7%a7%bb%e5%8b%95%e7%ab%af%e9%81%a9%e9%85%8d%e4%bd%a0%e9%82%84%e7%94%a8flexible-js%e5%97%8e%ef%bc%9fvwrem%e4%b8%80%e8%a1%8c%e4%bb%a3%e7%a2%bc%e6%90%9e%e5%ae%9a","status":"publish","type":"post","link":"https:\/\/www.strongd.net\/?p=1600","title":{"rendered":"\u90fd2021\u79fb\u52d5\u7aef\u9069\u914d\u4f60\u9084\u7528flexible.js\u55ce\uff1fvw+rem\u4e00\u884c\u4ee3\u78bc\u641e\u5b9a"},"content":{"rendered":"<div>\n<h2 data-id=\"heading-0\"><span>\u4e86\u89e3\u4e00\u4e0brem<\/span><\/h2>\n<p><span>rem\uff08font size of the root element\uff09\u662f\u76f8\u5c0d\u9577\u5ea6\u55ae\u4f4d\u3002\u76f8\u5c0d\u65bc\u6839\u5143\u7d20\uff08\u5373html \u5143\u7d20\uff09font-size \u8a08\u7b97\u503c\u7684\u500d\u6578\u3002<\/span><\/p>\n<p><span>\u9069\u914d\u539f\u7406\uff1a\u5c07px \u66ff\u63db\u6210rem\uff0c\u52d5\u614b\u4fee\u6539html \u7684font-size \u9069\u914d\u3002\u5b83\u53ef\u4ee5\u5f88\u597d\u7684\u6839\u64da\u6839\u5143\u7d20\u7684\u5b57\u9ad4\u5927\u5c0f\u4f86\u9032\u884c\u8b8a\u5316\uff0c\u5f9e\u800c\u9054\u5230\u5404\u7a2e\u5c4f\u5e55\u57fa\u672c\u4e00\u81f4\u7684\u6548\u679c\u9ad4\u9a57<\/span><\/p>\n<h2 data-id=\"heading-1\"><span>u \u540c\u5b78\u7d66\u7684\u8a2d\u8a08\u7a3f<\/span><\/h2>\n<p><span>\u5e38\u898b\u7684\u8a2d\u8a08\u5716\u5bec\u5ea6\uff0c\u7576\u7136\u4e5f\u53ef\u4ee5\u662f\u5176\u4ed6\u7684\u5bec\u5ea6\uff0c\u6bd4\u5982720 \u50cf\u7d20\u7684<\/span><\/p>\n<ol>\n<li><span>375 iPhone7<\/span><\/li>\n<li><span>750 \u4e8c\u500d\u5716<\/span><\/li>\n<li><span>320 iPhone5<\/span><\/li>\n<li><span>640 \u4e8c\u500d\u5716<\/span><\/li>\n<\/ol>\n<p><span>\u70ba\u4ec0\u9ebc\u7d66\u7684\u662f375\uff1f\u56e0\u70ba\u9019\u500b\u662fiPhone7 \u7684\u5bec\u5ea6\uff0c<\/span><\/p>\n<p><span>\u4e5f\u5c31\u662f\u8aaa\u6700\u4f4e\u517c\u5bb9\u5230375 \u50cf\u7d20\u7684\u5c4f\u5e55\u3002\uff08\u4f4e\u65bc375 \u4f48\u5c40\u53ef\u80fd\u6703\u4e82\uff09<\/span><\/p>\n<p><span>\u5176\u4ed6\u7684\u540c\u7406<\/span><\/p>\n<h2 data-id=\"heading-2\"><span>1. vw + rem \u65b9\u6848<\/span><\/h2>\n<p><span>\u5982\u679c\u6548\u679c\u5716\u662f375px \u7684\uff0c<\/span><\/p>\n<p><span>html \u7684style \u5c6c\u6027\u7684font-size \u8a2d\u7f6e\u70ba26.666666vw<\/span><\/p>\n<p><span>css \u4e2d20px \u6539\u5beb\u70ba0.2rem \u5373\u53ef<\/span><\/p>\n<pre><code class=\"hljs language-html copyable\" lang=\"html\"><span class=\"hljs-meta\">&lt;!DOCTYPE <span class=\"hljs-meta-keyword\">html<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">html<\/span> <span class=\"hljs-attr\">lang<\/span>=<span class=\"hljs-string\">\"en\"<\/span> <span class=\"hljs-attr\">style<\/span>=<span class=\"hljs-string\">\"font-size: 26.666666vw\"<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">head<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">meta<\/span> <span class=\"hljs-attr\">charset<\/span>=<span class=\"hljs-string\">\"UTF-8\"<\/span> \/&gt;<\/span>\r\n        <span class=\"hljs-comment\">&lt;!--\r\n        \u4e0b\u9762\u4e00\u884c\u4ee3\u7801\u7684\u89e3\u6790\uff1a\r\n        width=device-width \u5185\u5bb9\u5bbd\u5ea6 \u7b49\u4e8e \u8bbe\u5907\u5bbd\u5ea6\uff0c\u6362\u53e5\u8bdd\u8bf4 \u7f51\u9875\u5bbd\u5ea6\u4e3a\u8bbe\u5907\u5bbd\u5ea6\r\n        initial-scale=1.0 \u521d\u59cb\u7f29\u653e\u6bd4\u7b49\u4e8e1.0\u500d\uff0c\u6362\u53e5\u8bdd\u8bf4 \u7f51\u9875\u521d\u59cb\u5316\u7f29\u653e\u6bd4\u4e3a1.0 \u5c31\u662f\u9ed8\u8ba4\u4e0d\u7f29\u653e\r\n    --&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">meta<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\">\"viewport\"<\/span> <span class=\"hljs-attr\">content<\/span>=<span class=\"hljs-string\">\"width=device-width, initial-scale=1.0\"<\/span> \/&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">meta<\/span> <span class=\"hljs-attr\">http-equiv<\/span>=<span class=\"hljs-string\">\"X-UA-Compatible\"<\/span> <span class=\"hljs-attr\">content<\/span>=<span class=\"hljs-string\">\"ie=edge\"<\/span> \/&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">title<\/span>&gt;<\/span>Document<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">title<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">style<\/span>&gt;<\/span><span class=\"css\">\r\n            <span class=\"hljs-comment\">\/* \u8bbe\u7f6e div \u4e3a\u5bbd\u5ea6100px\u9ad8\u5ea618px *\/<\/span>\r\n            <span class=\"hljs-selector-class\">.app-main<\/span> {\r\n                <span class=\"hljs-comment\">\/* \u79fb\u52a8\u7aef\u5199\u6cd5 *\/<\/span>\r\n                <span class=\"hljs-attribute\">width<\/span>: <span class=\"hljs-number\">1rem<\/span>;\r\n                <span class=\"hljs-attribute\">height<\/span>: <span class=\"hljs-number\">0.18rem<\/span>;\r\n                <span class=\"hljs-comment\">\/* \r\n                PC\u7aef\u5199\u6cd5\r\n                width: 100px;\r\n                height: 18px; *\/<\/span>\r\n            }\r\n        <\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">style<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">head<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">body<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"app-main\"<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">body<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">html<\/span>&gt;<\/span>\r\n<span class=\"copy-code-btn\">\u590d\u5236\u4ee3\u7801<\/span><\/code><\/pre>\n<p><span>\u70ba\u4ec0\u9ebc\u662f26.666666vw\uff1f\u5f97\u4e86\u89e3\u4e0b\u9762\u5e7e\u500b\u554f\u984c<\/span><\/p>\n<pre><code class=\"copyable\">-   1. \u4ec0\u4e48\u662f viewport\uff1f\r\n-   2. \u4e3a\u4ec0\u4e48\u8981\u7528\u5b83\uff1f\r\n-   3. \u600e\u4e48\u7528\uff1f\r\n-   4. `vw`\u3001`vh`\u662f\u4ec0\u4e48?\r\n\r\n\u7b54\uff1a\r\n\r\n1. \u4ec0\u4e48\u662f viewport\uff1f\r\n   [MDN viewport](https:\/\/developer.mozilla.org\/zh-CN\/docs\/Web\/CSS\/Viewport_concepts)\u7684\u89e3\u6790\u662f\r\n   \u89c6\u53e3(viewport)\u4ee3\u8868\u5f53\u524d\u53ef\u89c1\u7684\u8ba1\u7b97\u673a\u56fe\u5f62\u533a\u57df\u3002\u5728 Web \u6d4f\u89c8\u5668\u672f\u8bed\u4e2d\uff0c\u901a\u5e38\u4e0e\u6d4f\u89c8\u5668\u7a97\u53e3\u76f8\u540c\uff0c\u4f46\u4e0d\u5305\u62ec\u6d4f\u89c8\u5668\u7684 UI\uff0c \u83dc\u5355\u680f\u7b49\u2014\u2014\u5373\u6307\u4f60\u6b63\u5728\u6d4f\u89c8\u7684\u6587\u6863\u7684\u90a3\u4e00\u90e8\u5206\u3002\r\n\r\n2. \u7528\u5b83\u6765\u79fb\u52a8\u7aef\u9002\u914d\uff0c\u517c\u5bb9\u4e0d\u540c\u7684\u8bbe\u5907\uff0c\u5f53\u7136\u4e0d\u5c40\u9650\u4e8e\u79fb\u52a8\u7aef\uff0c\u8fd9\u91cc\u53ea\u8ba8\u8bba\u79fb\u52a8\u7aef\r\n\r\n3. \u53ea\u9700\u8981\u5728`head`\u4e2d\u5b9a\u4e49 `&lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" \/&gt;`\u5c31\u884c\uff0c\u5177\u4f53\u5982\u4e0b\uff1a\r\n\r\n`\r\n&lt;head&gt;\r\n    &lt;meta charset=\"UTF-8\" \/&gt;\r\n    &lt;!--\r\n        \u4e0b\u9762\u4e00\u884c\u4ee3\u7801\u7684\u89e3\u6790\uff1a\r\n        width=device-width \u5185\u5bb9\u5bbd\u5ea6 \u7b49\u4e8e \u8bbe\u5907\u5bbd\u5ea6\uff0c\u6362\u53e5\u8bdd\u8bf4 \u7f51\u9875\u5bbd\u5ea6\u4e3a\u8bbe\u5907\u5bbd\u5ea6\r\n        initial-scale=1.0 \u521d\u59cb\u7f29\u653e\u6bd4\u7b49\u4e8e1.0\u500d\uff0c\u6362\u53e5\u8bdd\u8bf4 \u7f51\u9875\u521d\u59cb\u5316\u7f29\u653e\u6bd4\u4e3a1.0 \u5c31\u662f\u9ed8\u8ba4\u4e0d\u7f29\u653e\r\n    --&gt;\r\n    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" \/&gt;\r\n    &lt;meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\" \/&gt;\r\n    &lt;title&gt;Document&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n`\r\n\r\n4.  `vw` \u662f\u89c6\u53e3\u5bbd\u5ea6\u7684\u4e00\u4e2a\u5355\u4f4d\uff0cviewport width \u7684\u7b80\u79f0\uff0c\u6839\u636e viewport \u76f8\u5173\u5b9a\u4e49\uff0c\r\n    \u5df2\u7ecf\u5b9a\u4e49\u597d\u4e86\u7684\uff0cPC \u7aef 100vw \u5c31\u7b49\u4e8e\u6d4f\u89c8\u5668\u7684\u5bbd\u5ea6\uff0c\u79fb\u52a8\u7aef 100vw \u5c31\u662f\u8bbe\u5907\u7684\u5bbd\u5ea6(\u6309\u7167\u4e0a\u9762\u7684 width=device-width)\r\n    `vh` \u540c\u7406\uff0c\u662f\u89c6\u53e3\u9ad8\u5ea6\uff0cviewport height \u7684\u7b80\u79f0\uff0c100vh \u5c31\u662f\u53ef\u89c6\u7a97\u53e3\u7684\u9ad8\u5ea6\r\n<span class=\"copy-code-btn\">\u590d\u5236\u4ee3\u7801<\/span><\/code><\/pre>\n<p><span>\u4e86\u89e3\u5b8c\u4e0a\u9762\u7684\u77e5\u8b58\u9ede\uff0c\u6211\u5011\u53ef\u4ee5\u56de\u7b54<\/span><\/p>\n<p><span>\u70ba\u4ec0\u9ebcfont-size \u8a2d\u7f6e\u621026.666666vw?<\/span><\/p>\n<pre><code class=\"copyable\">\u8bbe\u8ba1\u56fe\u7684\u5bbd\u5ea6 = \u8bbe\u5907\u5bbd\u5ea6\r\n\u5047\u5982 \u8bbe\u8ba1\u56fe\u7684\u5bbd\u5ea6\u4e3a 375px\uff0c\u5f53\u7136\u53ef\u4ee5\u662f\u5176\u4ed6\u7684\uff0c\u8fd9\u91cc\u662f\u4e00\u4e2a\u5047\u5982\uff0c\u5982\u679c\u662f640\uff0c750\u5c31\u628a375\u6362\u6210\u5bf9\u5e94\u7684\u6570\u503c\u6309\u7167\u4ee5\u4e0b\u65b9\u6cd5\u6362\u7b97\u5c31\u884c\u5c31\u884c\r\n\u56e0\u4e3a\r\n    375px = 100vw\r\n\u90a3\u4e48\r\n    1px = 100 \/ 375 vw = 0.26666666666666666vw\uff08\u7ea6\u7b49\u4e8e\uff09\r\n\r\n\u4e3a\u4e86\u65b9\u4fbf\u8ba1\u7b97\uff0c\u653e\u5927\u4e00\u767e\u500d\uff0c\u7cbe\u786e\u52306\u4f4d\uff0c\u53ea\u80fd\u4e0b\u53d6\u820d\uff0c\u56e0\u4e3a\u4e0a\u53d6\u820d\uff0c\u8ba1\u7b97\u5bbd\u5ea6\u7684\u65f6\u5019\u4f1a\u5927\u4e8e\u9875\u9762\u5bbd\u5ea6\uff0c\u4ece\u800c\u51fa\u73b0\u6eda\u52a8\u6761\r\n\u6545\uff1a\r\n    100px = 26.666666vw\uff08\u7ea6\u7b49\u4e8e\uff09\r\n\r\n\u53c8\u56e0\u4e3a\u7ed9 html \u6807\u7b7e\u8bbe\u7f6e font-size \u4e3a 26.666666vw \uff08\u7ea6\u7b49\u4e8e\uff09\r\n\r\n1rem\u4e3afont-size\u7684\u5927\u5c0f\r\n\r\n\u6240\u4ee5\uff1a\r\n    1rem = 100px\r\n    0.2rem = 20px\r\n\u4e5f\u5c31\u662f\u8bf4\uff1a\r\n    \u8bbe\u8ba1\u56fe\u4e0a\u7684 12px \u6362\u7b97\u6210rem\u5c31\u662f0.12rem\uff0c20px\u5c31\u5199\u62100.2rem\u5373\u53ef\r\n<span class=\"copy-code-btn\">\u590d\u5236\u4ee3\u7801<\/span><\/code><\/pre>\n<p><span>\u512a\u9ede\uff1a\u4e0d\u9700\u8981\u5f15\u5165\u65b0\u7684js\uff0c\u4e00\u884c\u4ee3\u78bc\u641e\u5b9a\u9069\u914d\u554f\u984c\u7f3a\u9ede\uff1a\u700f\u89bd\u5668\u517c\u5bb9\u6027\u5dee\uff0cIE9 \u4ee5\u4e0b\u4e0d\u652f\u6301\uff0c\u4f46\u73fe\u4ee3\u700f\u89bd\u5668\uff0c\u7279\u5225\u662f\u79fb\u52d5\u7aef\uff0c\u57fa\u672c\u90fd\u652f\u6301<\/span><\/p>\n<hr \/>\n<p><span>\u53ef\u4ee5\u53c3\u8003\uff1a<\/span><\/p>\n<table>\n<thead>\n<tr>\n<th><span>\u8a2d\u8a08\u5716\u5927\u5c0f\uff08\u55ae\u4f4dpx\uff09<\/span><\/th>\n<th align=\"center\"><span>html \u7684font-size\uff08\u55ae\u4f4dvw\uff09<\/span><\/th>\n<th><span>\u5099\u8a3b<\/span><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><span>375<\/span><\/td>\n<td align=\"center\"><span>26.666666<\/span><\/td>\n<td><span>\u6548\u679c\u571620px\uff0c\u4ee3\u78bc\u61c9\u8a72\u5beb0.2rem<\/span><\/td>\n<\/tr>\n<tr>\n<td><span>750<\/span><\/td>\n<td align=\"center\"><span>13.333333<\/span><\/td>\n<td><span>\u6548\u679c\u571620px\uff0c\u4ee3\u78bc\u61c9\u8a72\u5beb0.2rem<\/span><\/td>\n<\/tr>\n<tr>\n<td><span>320<\/span><\/td>\n<td align=\"center\"><span>31.25<\/span><\/td>\n<td><span>\u6548\u679c\u571620px\uff0c\u4ee3\u78bc\u61c9\u8a72\u5beb0.2rem<\/span><\/td>\n<\/tr>\n<tr>\n<td><span>640<\/span><\/td>\n<td align=\"center\"><span>15.625<\/span><\/td>\n<td><span>\u6548\u679c\u571620px\uff0c\u4ee3\u78bc\u61c9\u8a72\u5beb0.2rem<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 data-id=\"heading-3\"><span>2. flexible \u65b9\u6848\uff0c\uff08\u963f\u91cc\uff09<\/span><\/h2>\n<p><span>\u5728<\/span><a title=\"https:\/\/github.com\/amfe\/lib-flexible\" href=\"https:\/\/link.juejin.cn?target=https%3A%2F%2Fgithub.com%2Famfe%2Flib-flexible\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><span>lib-flexible<\/span><\/a><span>\u7684github \u4e0a\u6709\u8457\u9019\u6a23\u7684\u4e00\u53e5\u8a71\u3002<\/span><\/p>\n<blockquote><p><span>\u7531\u65bc <\/span><code>viewport<\/code><span> \u55ae\u4f4d\u5f97\u5230\u773e\u591a\u700f\u89bd\u5668\u7684\u517c\u5bb9\uff0c<\/span><code>lib-flexible<\/code><span>\u9019\u500b\u904e\u6e21\u65b9\u6848\u5df2\u7d93\u53ef\u4ee5\u653e\u68c4\u4f7f\u7528\uff0c\u4e0d\u7ba1\u662f\u73fe\u5728\u7684\u7248\u672c\u9084\u662f\u4ee5\u524d\u7684\u7248\u672c\uff0c\u90fd\u5b58\u6709\u4e00\u5b9a\u7684\u554f\u984c\u3002\u5efa\u8b70\u5927\u5bb6\u958b\u59cb\u4f7f\u7528viewport \u4f86\u66ff\u4ee3\u6b64\u65b9\u6848\u3002<\/span><code>vw<\/code><span>\u7684\u517c\u5bb9\u65b9\u6848\u53ef\u4ee5\u53c3\u95b1\u300a\u5982\u4f55\u5728Vue \u9805\u76ee\u4e2d\u4f7f\u7528vw \u5be6\u73fe\u79fb\u52d5\u7aef\u9069\u914d\u300b\u4e00\u6587\u3002<\/span><\/p><\/blockquote>\n<p><span>\u6211\u5011\u53ef\u4ee5\u5f97\u5230\u4e00\u500b\u5f88\u660e\u78ba\u7684\u4fe1\u606f\uff0clib-flexible \u9019\u500b\u65b9\u6848\u5df2\u7d93\u88ab\u653e\u68c4\u4f7f\u7528\u4e86\uff0c\u6211\u5011\u53ef\u4ee5\u53bb\u64c1\u62b1 <\/span><code>vw<\/code><span> \u7684\u90a3\u5957\u5be6\u73fe\u65b9\u6848\u3002<\/span><\/p>\n<h2 data-id=\"heading-4\"><span>3. \u57fa\u65bcflexible \u7684<\/span><a title=\"https:\/\/github.com\/LinkSun\/hotcss\" href=\"https:\/\/link.juejin.cn?target=https%3A%2F%2Fgithub.com%2FLinkSun%2Fhotcss\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><span>hotcss<\/span><\/a><span>\u65b9\u6848<\/span><\/h2>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4e86\u89e3\u4e00\u4e0brem rem\uff08font size of the root element\uff09\u662f\u76f8\u5c0d\u9577\u5ea6\u55ae\u4f4d\u3002\u76f8\u5c0d\u65bc\u6839\u5143\u7d20\uff08\u5373html \u5143\u7d20\uff09font-size \u8a08\u7b97\u503c\u7684\u500d\u6578\u3002 \u9069\u914d\u539f\u7406\uff1a\u5c07px \u66ff\u63db\u6210rem\uff0c\u52d5\u614b\u4fee\u6539html \u7684font-size \u9069\u914d\u3002\u5b83\u53ef\u4ee5\u5f88\u597d\u7684\u6839\u64da\u6839\u5143\u7d20\u7684\u5b57\u9ad4\u5927\u5c0f\u4f86\u9032\u884c\u8b8a\u5316\uff0c\u5f9e\u800c\u9054\u5230\u5404\u7a2e\u5c4f\u5e55\u57fa\u672c\u4e00\u81f4\u7684\u6548\u679c\u9ad4\u9a57 u \u540c\u5b78\u7d66\u7684\u8a2d\u8a08\u7a3f \u5e38\u898b\u7684\u8a2d\u8a08\u5716\u5bec\u5ea6\uff0c\u7576\u7136\u4e5f\u53ef\u4ee5\u662f\u5176\u4ed6\u7684\u5bec\u5ea6\uff0c\u6bd4\u5982720 \u50cf\u7d20\u7684 375 iPhone7 750 \u4e8c\u500d\u5716 320 iPhone5 640 \u4e8c\u500d\u5716 \u70ba\u4ec0\u9ebc\u7d66\u7684\u662f375\uff1f\u56e0\u70ba\u9019\u500b\u662fiPhone7 \u7684\u5bec\u5ea6\uff0c \u4e5f\u5c31\u662f\u8aaa\u6700\u4f4e\u517c\u5bb9\u5230375 \u50cf\u7d20\u7684\u5c4f\u5e55\u3002\uff08\u4f4e\u65bc375 \u4f48\u5c40\u53ef\u80fd\u6703\u4e82\uff09 \u5176\u4ed6\u7684\u540c\u7406 1. vw + rem \u65b9\u6848 \u5982\u679c\u6548\u679c\u5716\u662f375px \u7684\uff0c html \u7684style \u5c6c\u6027\u7684font-size \u8a2d\u7f6e\u70ba26.666666vw css \u4e2d20px \u6539\u5beb\u70ba0.2rem \u5373\u53ef &lt;!DOCTYPE html&gt; &lt;html lang=&#8221;en&#8221; style=&#8221;font-size: 26.666666vw&#8221;&gt; &lt;head&gt; &lt;meta charset=&#8221;UTF-8&#8243; &hellip; <a href=\"https:\/\/www.strongd.net\/?p=1600\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">\u90fd2021\u79fb\u52d5\u7aef\u9069\u914d\u4f60\u9084\u7528flexible.js\u55ce\uff1fvw+rem\u4e00\u884c\u4ee3\u78bc\u641e\u5b9a<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[],"class_list":["post-1600","post","type-post","status-publish","format-standard","hentry","category-35"],"_links":{"self":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/1600","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1600"}],"version-history":[{"count":1,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/1600\/revisions"}],"predecessor-version":[{"id":1601,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/1600\/revisions\/1601"}],"wp:attachment":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}