{"id":786,"date":"2025-12-14T14:45:17","date_gmt":"2025-12-14T06:45:17","guid":{"rendered":"https:\/\/www.52runoob.com\/?p=786"},"modified":"2025-12-14T14:45:17","modified_gmt":"2025-12-14T06:45:17","slug":"html5%e7%9a%84%e5%93%8d%e5%ba%94%e5%bc%8f%e5%b8%83%e5%b1%80%e7%9a%84%e6%96%b9%e6%b3%95%e7%a4%ba%e4%be%8b%e8%af%a6%e8%a7%a3-2","status":"publish","type":"post","link":"https:\/\/www.52runoob.com\/index.php\/2025\/12\/14\/html5%e7%9a%84%e5%93%8d%e5%ba%94%e5%bc%8f%e5%b8%83%e5%b1%80%e7%9a%84%e6%96%b9%e6%b3%95%e7%a4%ba%e4%be%8b%e8%af%a6%e8%a7%a3-2\/","title":{"rendered":"html5\u7684\u54cd\u5e94\u5f0f\u5e03\u5c40\u7684\u65b9\u6cd5\u793a\u4f8b\u8be6\u89e3"},"content":{"rendered":"\n<p>\u4e0b\u9762\u662f\u4e00\u7bc7<strong>\u7ed3\u6784\u5b8c\u6574\u3001\u793a\u4f8b\u6e05\u6670\u3001\u53ef\u76f4\u63a5\u7528\u4e8e\u6559\u7a0b\u6216\u535a\u5ba2\u53d1\u5e03\u7684\u6587\u7ae0<\/strong>\uff0c\u8be6\u7ec6\u8bb2\u89e3 <strong>HTML5 \u7684\u54cd\u5e94\u5f0f\u5e03\u5c40\u65b9\u6cd5\u4e0e\u793a\u4f8b<\/strong>\uff0c\u9002\u5408\u65b0\u624b\u5230\u8fdb\u9636\u5b66\u4e60\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">HTML5 \u7684\u54cd\u5e94\u5f0f\u5e03\u5c40\u65b9\u6cd5\u793a\u4f8b\u8be6\u89e3<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e00\u3001\u4ec0\u4e48\u662f\u54cd\u5e94\u5f0f\u5e03\u5c40\uff1f<\/h2>\n\n\n\n<p><strong>\u54cd\u5e94\u5f0f\u5e03\u5c40\uff08Responsive Web Design\uff09<\/strong> \u6307\u7684\u662f\u7f51\u9875\u80fd\u591f\u6839\u636e\u4e0d\u540c\u8bbe\u5907\u7684\u5c4f\u5e55\u5c3a\u5bf8\uff08\u624b\u673a\u3001\u5e73\u677f\u3001\u7535\u8111\uff09\u81ea\u52a8\u8c03\u6574\u5e03\u5c40\u548c\u6837\u5f0f\uff0c\u4fdd\u8bc1\u826f\u597d\u7684\u6d4f\u89c8\u4f53\u9a8c\u3002<\/p>\n\n\n\n<p>\u6838\u5fc3\u76ee\u6807\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e00\u5957\u4ee3\u7801<\/li>\n\n\n\n<li>\u9002\u914d\u591a\u79cd\u5c4f\u5e55<\/li>\n\n\n\n<li>\u65e0\u9700\u4e3a\u4e0d\u540c\u8bbe\u5907\u5355\u72ec\u5f00\u53d1\u9875\u9762<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001\u54cd\u5e94\u5f0f\u5e03\u5c40\u7684\u6838\u5fc3\u6280\u672f<\/h2>\n\n\n\n<p>HTML5 \u54cd\u5e94\u5f0f\u5e03\u5c40\u4e3b\u8981\u4f9d\u8d56\u4ee5\u4e0b\u51e0\u79cd\u6280\u672f\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>viewport \u89c6\u53e3\u8bbe\u7f6e<\/li>\n\n\n\n<li>\u5a92\u4f53\u67e5\u8be2\uff08Media Queries\uff09<\/li>\n\n\n\n<li>\u5f39\u6027\u5e03\u5c40\uff08Flexbox\uff09<\/li>\n\n\n\n<li>\u7f51\u683c\u5e03\u5c40\uff08Grid\uff09<\/li>\n\n\n\n<li>\u767e\u5206\u6bd4 \/ vw \/ vh \/ rem \u5355\u4f4d<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001\u8bbe\u7f6e viewport\uff08\u5fc5\u4e0d\u53ef\u5c11\uff09<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u4f5c\u7528<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u63a7\u5236\u9875\u9762\u5728\u79fb\u52a8\u8bbe\u5907\u4e0a\u7684\u7f29\u653e\u6bd4\u4f8b<\/li>\n\n\n\n<li>\u9632\u6b62\u9875\u9762\u88ab\u5f3a\u5236\u7f29\u653e\u6210\u684c\u9762\u5bbd\u5ea6<\/li>\n<\/ul>\n\n\n\n<p>\ud83d\udccc <strong>\u6ca1\u6709 viewport\uff0c\u5c31\u8c08\u4e0d\u4e0a\u771f\u6b63\u7684\u54cd\u5e94\u5f0f<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u56db\u3001\u5a92\u4f53\u67e5\u8be2\uff08Media Queries\uff09<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u57fa\u672c\u8bed\u6cd5<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n@media (max-width: 768px) {\n    body {\n        background-color: #f2f2f2;\n    }\n}\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u5e38\u7528\u65ad\u70b9\u53c2\u8003<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u8bbe\u5907<\/th><th>\u5bbd\u5ea6<\/th><\/tr><\/thead><tbody><tr><td>\u624b\u673a<\/td><td>\u2264 768px<\/td><\/tr><tr><td>\u5e73\u677f<\/td><td>768px \u2013 1024px<\/td><\/tr><tr><td>\u684c\u9762<\/td><td>\u2265 1024px<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e94\u3001Flex \u5f39\u6027\u5e03\u5c40\uff08\u6700\u5e38\u7528\uff09<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u793a\u4f8b\uff1a\u54cd\u5e94\u5f0f\u5bfc\u822a\u680f<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;div class=&quot;nav&quot;&gt;\n    &amp;lt;div&gt;Home&amp;lt;\/div&gt;\n    &amp;lt;div&gt;About&amp;lt;\/div&gt;\n    &amp;lt;div&gt;Contact&amp;lt;\/div&gt;\n&amp;lt;\/div&gt;\n\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n.nav {\n    display: flex;\n    justify-content: space-around;\n}\n\n@media (max-width: 600px) {\n    .nav {\n        flex-direction: column;\n        text-align: center;\n    }\n}\n\n<\/pre><\/div>\n\n\n<p>\ud83d\udccc <strong>\u6548\u679c<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u684c\u9762\u7aef\uff1a\u6a2a\u5411\u6392\u5217<\/li>\n\n\n\n<li>\u624b\u673a\u7aef\uff1a\u7eb5\u5411\u6392\u5217<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u516d\u3001Grid \u7f51\u683c\u5e03\u5c40\uff08\u590d\u6742\u5e03\u5c40\u63a8\u8350\uff09<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u793a\u4f8b\uff1a\u54cd\u5e94\u5f0f\u5361\u7247\u5e03\u5c40<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;div class=&quot;grid&quot;&gt;\n    &amp;lt;div class=&quot;item&quot;&gt;1&amp;lt;\/div&gt;\n    &amp;lt;div class=&quot;item&quot;&gt;2&amp;lt;\/div&gt;\n    &amp;lt;div class=&quot;item&quot;&gt;3&amp;lt;\/div&gt;\n&amp;lt;\/div&gt;\n\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n.grid {\n    display: grid;\n    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n    gap: 20px;\n}\n\n<\/pre><\/div>\n\n\n<p>\ud83d\udccc <strong>\u4f18\u52bf<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u81ea\u52a8\u6362\u884c<\/li>\n\n\n\n<li>\u65e0\u9700\u5a92\u4f53\u67e5\u8be2<\/li>\n\n\n\n<li>\u975e\u5e38\u9002\u5408\u5546\u54c1\u5217\u8868\u3001\u56fe\u7247\u5899<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e03\u3001\u767e\u5206\u6bd4 \/ vw \/ vh \/ rem \u5355\u4f4d<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u767e\u5206\u6bd4\u5e03\u5c40<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n.box {\n    width: 50%;\n}\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">vw \/ vh<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n.banner {\n    height: 100vh;\n}\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">rem\uff08\u63a8\u8350\uff09<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nhtml {\n    font-size: 16px;\n}\n\nh1 {\n    font-size: 2rem;\n}\n\n<\/pre><\/div>\n\n\n<p>\ud83d\udccc rem \u9002\u5408\u6574\u4f53\u7f29\u653e<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u516b\u3001\u56fe\u7247\u54cd\u5e94\u5f0f\u5904\u7406<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u65b9\u6cd5\u4e00\uff1amax-width<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nimg {\n    max-width: 100%;\n    height: auto;\n}\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u65b9\u6cd5\u4e8c\uff1apicture\uff08HTML5\uff09<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;picture&gt;\n    &amp;lt;source media=&quot;(max-width:600px)&quot; srcset=&quot;small.jpg&quot;&gt;\n    &amp;lt;img src=&quot;large.jpg&quot; alt=&quot;&quot;&gt;\n&amp;lt;\/picture&gt;\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e5d\u3001\u5b8c\u6574\u54cd\u5e94\u5f0f\u793a\u4f8b\uff08\u63a8\u8350\uff09<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">HTML<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;div class=&quot;container&quot;&gt;\n    &amp;lt;div class=&quot;box&quot;&gt;A&amp;lt;\/div&gt;\n    &amp;lt;div class=&quot;box&quot;&gt;B&amp;lt;\/div&gt;\n    &amp;lt;div class=&quot;box&quot;&gt;C&amp;lt;\/div&gt;\n&amp;lt;\/div&gt;\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">CSS<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n.container {\n    display: flex;\n    gap: 10px;\n}\n\n.box {\n    flex: 1;\n    height: 100px;\n    background: #4caf50;\n}\n\n@media (max-width: 768px) {\n    .container {\n        flex-direction: column;\n    }\n}\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5341\u3001\u54cd\u5e94\u5f0f\u5e03\u5c40\u6700\u4f73\u5b9e\u8df5<\/h2>\n\n\n\n<p>\u2705 \u79fb\u52a8\u7aef\u4f18\u5148\uff08Mobile First\uff09<br>\u2705 \u4f7f\u7528 Flex \/ Grid<br>\u2705 \u5c11\u7528\u56fa\u5b9a\u5bbd\u9ad8<br>\u2705 \u591a\u7528 rem \/ %<br>\u274c \u907f\u514d\u5199\u6b7b px<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5341\u4e00\u3001\u5e38\u89c1\u8bef\u533a<\/h2>\n\n\n\n<p>\u274c \u53ea\u9002\u914d\u4e00\u79cd\u5206\u8fa8\u7387<br>\u274c \u5a92\u4f53\u67e5\u8be2\u5199\u592a\u591a<br>\u274c \u4f7f\u7528 table \u5e03\u5c40<br>\u274c \u4e0d\u6d4b\u8bd5\u771f\u673a<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5341\u4e8c\u3001\u4e00\u53e5\u8bdd\u603b\u7ed3<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>\u54cd\u5e94\u5f0f\u5e03\u5c40 = viewport + \u5f39\u6027\u5e03\u5c40 + \u5a92\u4f53\u67e5\u8be2<\/strong><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0b\u9762\u662f\u4e00\u7bc7\u7ed3\u6784\u5b8c\u6574\u3001\u793a\u4f8b\u6e05\u6670\u3001\u53ef\u76f4\u63a5\u7528\u4e8e\u6559\u7a0b\u6216\u535a\u5ba2\u53d1\u5e03\u7684\u6587\u7ae0\uff0c\u8be6\u7ec6\u8bb2\u89e3 HTML&#8230; <a class=\"more-link\" href=\"https:\/\/www.52runoob.com\/index.php\/2025\/12\/14\/html5%e7%9a%84%e5%93%8d%e5%ba%94%e5%bc%8f%e5%b8%83%e5%b1%80%e7%9a%84%e6%96%b9%e6%b3%95%e7%a4%ba%e4%be%8b%e8%af%a6%e8%a7%a3-2\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-786","post","type-post","status-publish","format-standard","hentry","category-html5"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/786","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/comments?post=786"}],"version-history":[{"count":1,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/786\/revisions"}],"predecessor-version":[{"id":787,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/786\/revisions\/787"}],"wp:attachment":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/media?parent=786"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/categories?post=786"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/tags?post=786"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}