{"id":34,"date":"2025-11-20T16:41:54","date_gmt":"2025-11-20T08:41:54","guid":{"rendered":"https:\/\/www.52runoob.com\/?p=34"},"modified":"2025-11-20T16:41:54","modified_gmt":"2025-11-20T08:41:54","slug":"html%e5%ae%9e%e7%8e%b0%e8%9c%82%e7%aa%9d%e8%8f%9c%e5%8d%95%e7%9a%84%e7%a4%ba%e4%be%8b%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"https:\/\/www.52runoob.com\/index.php\/2025\/11\/20\/html%e5%ae%9e%e7%8e%b0%e8%9c%82%e7%aa%9d%e8%8f%9c%e5%8d%95%e7%9a%84%e7%a4%ba%e4%be%8b%e4%bb%a3%e7%a0%81\/","title":{"rendered":"html\u5b9e\u73b0\u8702\u7a9d\u83dc\u5355\u7684\u793a\u4f8b\u4ee3\u7801"},"content":{"rendered":"\n<p>\u8702\u7a9d\u83dc\u5355\uff08Honeycomb Menu\uff09\u662f\u4e00\u79cd\u5e03\u5c40\u8bbe\u8ba1\uff0c\u901a\u5e38\u5448\u73b0\u4e3a\u516d\u8fb9\u5f62\u6216\u5176\u4ed6\u5f62\u72b6\u7684\u56fe\u6807\uff0c\u5f62\u6210\u7c7b\u4f3c\u8702\u7a9d\u7684\u7ed3\u6784\u3002\u5b83\u5e38\u7528\u4e8e\u73b0\u4ee3\u7f51\u7ad9\u3001\u5e94\u7528\u7a0b\u5e8f\u548c\u4eea\u8868\u76d8\u4e2d\uff0c\u63d0\u4f9b\u4e00\u79cd\u5438\u5f15\u773c\u7403\u4e14\u529f\u80fd\u4e30\u5bcc\u7684\u5bfc\u822a\u65b9\u5f0f\u3002<\/p>\n\n\n\n<p>\u4e0b\u9762\u662f\u4e00\u4e2a\u4f7f\u7528 HTML\u3001CSS \u548c\u4e00\u70b9 JavaScript \u5b9e\u73b0\u8702\u7a9d\u83dc\u5355\u7684\u7b80\u5355\u793a\u4f8b\u3002\u6211\u4eec\u5c06\u4f7f\u7528 CSS \u6765\u5e03\u5c40\u516d\u8fb9\u5f62\u83dc\u5355\u9879\uff0c\u5e76\u901a\u8fc7 hover \u6548\u679c\u548c\u7b80\u5355\u7684\u52a8\u753b\u6765\u589e\u52a0\u4ea4\u4e92\u6027\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u793a\u4f8b\u4ee3\u7801<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">HTML \u90e8\u5206<\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;!DOCTYPE html&gt;\n&amp;lt;html lang=&quot;en&quot;&gt;\n&amp;lt;head&gt;\n    &amp;lt;meta charset=&quot;UTF-8&quot;&gt;\n    &amp;lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;\n    &amp;lt;title&gt;\u8702\u7a9d\u83dc\u5355&amp;lt;\/title&gt;\n    &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;styles.css&quot;&gt;\n&amp;lt;\/head&gt;\n&amp;lt;body&gt;\n    &amp;lt;div class=&quot;menu-container&quot;&gt;\n        &amp;lt;div class=&quot;menu-item&quot;&gt;\n            &amp;lt;a href=&quot;#home&quot; class=&quot;hexagon&quot;&gt;Home&amp;lt;\/a&gt;\n        &amp;lt;\/div&gt;\n        &amp;lt;div class=&quot;menu-item&quot;&gt;\n            &amp;lt;a href=&quot;#services&quot; class=&quot;hexagon&quot;&gt;Services&amp;lt;\/a&gt;\n        &amp;lt;\/div&gt;\n        &amp;lt;div class=&quot;menu-item&quot;&gt;\n            &amp;lt;a href=&quot;#about&quot; class=&quot;hexagon&quot;&gt;About&amp;lt;\/a&gt;\n        &amp;lt;\/div&gt;\n        &amp;lt;div class=&quot;menu-item&quot;&gt;\n            &amp;lt;a href=&quot;#contact&quot; class=&quot;hexagon&quot;&gt;Contact&amp;lt;\/a&gt;\n        &amp;lt;\/div&gt;\n        &amp;lt;div class=&quot;menu-item&quot;&gt;\n            &amp;lt;a href=&quot;#portfolio&quot; class=&quot;hexagon&quot;&gt;Portfolio&amp;lt;\/a&gt;\n        &amp;lt;\/div&gt;\n        &amp;lt;div class=&quot;menu-item&quot;&gt;\n            &amp;lt;a href=&quot;#blog&quot; class=&quot;hexagon&quot;&gt;Blog&amp;lt;\/a&gt;\n        &amp;lt;\/div&gt;\n    &amp;lt;\/div&gt;\n&amp;lt;\/body&gt;\n&amp;lt;\/html&gt;\n\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\">CSS \u90e8\u5206<\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n* {\n    margin: 0;\n    padding: 0;\n    box-sizing: border-box;\n}\n\nbody {\n    font-family: Arial, sans-serif;\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    height: 100vh;\n    background-color: #f4f4f4;\n}\n\n\/* \u83dc\u5355\u5bb9\u5668 *\/\n.menu-container {\n    display: grid;\n    grid-template-columns: repeat(3, 100px);\n    grid-template-rows: repeat(3, 100px);\n    grid-gap: 20px;\n    position: relative;\n}\n\n\/* \u516d\u8fb9\u5f62 *\/\n.hexagon {\n    position: relative;\n    width: 100px;\n    height: 58px;\n    background-color: #ff6f61;\n    color: white;\n    text-align: center;\n    line-height: 58px;\n    font-size: 16px;\n    font-weight: bold;\n    border-radius: 10px;\n    display: block;\n    text-decoration: none;\n    transform: rotate(30deg);\n    transition: transform 0.3s ease, background-color 0.3s ease;\n}\n\n.hexagon:before,\n.hexagon:after {\n    content: &#039;&#039;;\n    position: absolute;\n    width: 0;\n    height: 0;\n    border-left: 50px solid transparent;\n    border-right: 50px solid transparent;\n    transition: all 0.3s ease;\n}\n\n.hexagon:before {\n    top: -29px;\n    border-bottom: 29px solid #ff6f61;\n}\n\n.hexagon:after {\n    bottom: -29px;\n    border-top: 29px solid #ff6f61;\n}\n\n\/* \u70b9\u51fb\u6216\u60ac\u505c\u65f6\u7684\u6548\u679c *\/\n.hexagon:hover {\n    background-color: #e55d4e;\n    transform: scale(1.1) rotate(30deg);\n}\n\n\/* \u5e03\u5c40\u8c03\u6574 *\/\n.menu-item {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n}\n\n.menu-container .menu-item:nth-child(1) {\n    grid-column: 2;\n    grid-row: 1;\n}\n\n.menu-container .menu-item:nth-child(2) {\n    grid-column: 1;\n    grid-row: 2;\n}\n\n.menu-container .menu-item:nth-child(3) {\n    grid-column: 2;\n    grid-row: 2;\n}\n\n.menu-container .menu-item:nth-child(4) {\n    grid-column: 3;\n    grid-row: 2;\n}\n\n.menu-container .menu-item:nth-child(5) {\n    grid-column: 1;\n    grid-row: 3;\n}\n\n.menu-container .menu-item:nth-child(6) {\n    grid-column: 3;\n    grid-row: 3;\n}\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u89e3\u91ca<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>HTML\u7ed3\u6784<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>\u4f7f\u7528\u4e86\u4e00\u4e2a\u5bb9\u5668\u00a0<code>&lt;div class=\"menu-container\"><\/code>\u00a0\u6765\u627f\u8f7d\u591a\u4e2a\u83dc\u5355\u9879\uff0c\u6bcf\u4e2a\u83dc\u5355\u9879\u88ab\u5305\u88c5\u5728\u00a0<code>&lt;div class=\"menu-item\"><\/code>\u00a0\u4e2d\u3002<\/li>\n\n\n\n<li>\u6bcf\u4e2a\u83dc\u5355\u9879\u662f\u4e00\u4e2a\u00a0<code>&lt;a><\/code>\u00a0\u6807\u7b7e\uff0c\u901a\u8fc7\u00a0<code>class=\"hexagon\"<\/code>\u00a0\u6765\u5e94\u7528\u6837\u5f0f\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>CSS\u6837\u5f0f<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>\u4f7f\u7528\u00a0<strong>CSS Grid<\/strong>\u00a0\u6765\u521b\u5efa\u4e00\u4e2a 3&#215;3 \u7684\u7f51\u683c\u5e03\u5c40\u3002\u83dc\u5355\u9879\u4f7f\u7528 CSS Grid \u5b9a\u4e49\u4e86\u5b83\u4eec\u7684\u4f4d\u7f6e\uff0c\u901a\u8fc7\u00a0<code>grid-column<\/code>\u00a0\u548c\u00a0<code>grid-row<\/code>\u00a0\u6765\u5b9a\u4f4d\u6bcf\u4e2a\u83dc\u5355\u9879\u3002<\/li>\n\n\n\n<li>\u83dc\u5355\u9879\u672c\u8eab\u662f\u00a0<strong>\u516d\u8fb9\u5f62<\/strong>\uff0c\u901a\u8fc7\u65cb\u8f6c\u65b9\u5f62\u5757\uff08<code>transform: rotate(30deg);<\/code>\uff09\u6765\u5b9e\u73b0\u516d\u8fb9\u5f62\u5f62\u72b6\u3002<\/li>\n\n\n\n<li>\u4f7f\u7528\u00a0<code>:before<\/code>\u00a0\u548c\u00a0<code>:after<\/code>\u00a0\u4f2a\u5143\u7d20\u521b\u5efa\u516d\u8fb9\u5f62\u7684\u4e0a\u4e0b\u4e09\u89d2\u5f62\uff0c\u4ee5\u8865\u5145\u516d\u8fb9\u5f62\u7684\u5916\u89c2\u3002<\/li>\n\n\n\n<li><code>hover<\/code>\u00a0\u6548\u679c\u901a\u8fc7\u6539\u53d8\u80cc\u666f\u8272\u548c\u7f29\u653e\uff08<code>transform: scale(1.1)<\/code>\uff09\u6765\u5b9e\u73b0\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u52a8\u753b\u6548\u679c<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>\u4f7f\u7528\u00a0<code>transition<\/code>\u00a0\u4f7f\u5f97\u5728\u9f20\u6807\u60ac\u505c\u65f6\uff0c\u516d\u8fb9\u5f62\u4f1a\u5e73\u6ed1\u5730\u653e\u5927\u5e76\u6539\u53d8\u989c\u8272\uff0c\u7ed9\u7528\u6237\u5e26\u6765\u4ea4\u4e92\u7684\u53cd\u9988\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u6548\u679c<\/h3>\n\n\n\n<p>\u5f53\u52a0\u8f7d\u9875\u9762\u65f6\uff0c\u7528\u6237\u5c06\u770b\u5230\u4e00\u4e2a\u7531\u516d\u4e2a\u516d\u8fb9\u5f62\u56fe\u6807\u7ec4\u6210\u7684\u8702\u7a9d\u72b6\u83dc\u5355\u3002\u6bcf\u4e2a\u516d\u8fb9\u5f62\u4ee3\u8868\u4e00\u4e2a\u94fe\u63a5\uff0c\u9f20\u6807\u60ac\u505c\u65f6\u4f1a\u6709\u653e\u5927\u548c\u989c\u8272\u53d8\u5316\u7684\u6548\u679c\uff0c\u63d0\u4f9b\u826f\u597d\u7684\u4ea4\u4e92\u4f53\u9a8c\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u6269\u5c55<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6dfb\u52a0\u56fe\u6807<\/strong>\uff1a\u53ef\u4ee5\u5728\u516d\u8fb9\u5f62\u4e2d\u6dfb\u52a0\u56fe\u6807\u6765\u4ee3\u66ff\u6587\u672c\uff0c\u4f7f\u7528 FontAwesome \u6216\u8005\u5176\u4ed6\u56fe\u6807\u5e93\u3002<\/li>\n\n\n\n<li><strong>\u54cd\u5e94\u5f0f\u8bbe\u8ba1<\/strong>\uff1a\u53ef\u4ee5\u901a\u8fc7\u5a92\u4f53\u67e5\u8be2\u4f7f\u8702\u7a9d\u83dc\u5355\u5728\u4e0d\u540c\u5c4f\u5e55\u5c3a\u5bf8\u4e0b\u81ea\u9002\u5e94\u53d8\u5316\u3002<\/li>\n\n\n\n<li><strong>\u52a8\u753b\u6548\u679c<\/strong>\uff1a\u53ef\u4ee5\u4e3a\u83dc\u5355\u9879\u6dfb\u52a0\u66f4\u591a\u7684\u52a8\u753b\u6548\u679c\uff0c\u6bd4\u5982\u5f39\u8df3\u3001\u65cb\u8f6c\u7b49\uff0c\u4f7f\u5f97\u83dc\u5355\u66f4\u52a0\u751f\u52a8\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u8fd9\u79cd\u5e03\u5c40\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5438\u5f15\u7528\u6237\u6ce8\u610f\u7684\u65b9\u5f0f\uff0c\u975e\u5e38\u9002\u5408\u5177\u6709\u8f83\u591a\u5185\u5bb9\u6216\u8005\u670d\u52a1\u7684\u7ad9\u70b9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8702\u7a9d\u83dc\u5355\uff08Honeycomb Menu\uff09\u662f\u4e00\u79cd\u5e03\u5c40\u8bbe\u8ba1\uff0c\u901a\u5e38\u5448\u73b0\u4e3a\u516d\u8fb9\u5f62\u6216\u5176\u4ed6\u5f62&#8230; <a class=\"more-link\" href=\"https:\/\/www.52runoob.com\/index.php\/2025\/11\/20\/html%e5%ae%9e%e7%8e%b0%e8%9c%82%e7%aa%9d%e8%8f%9c%e5%8d%95%e7%9a%84%e7%a4%ba%e4%be%8b%e4%bb%a3%e7%a0%81\/\">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":[5],"tags":[],"class_list":["post-34","post","type-post","status-publish","format-standard","hentry","category-html-xhtml"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/34","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=34"}],"version-history":[{"count":1,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/34\/revisions"}],"predecessor-version":[{"id":35,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/34\/revisions\/35"}],"wp:attachment":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/media?parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/categories?post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/tags?post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}