{"id":441586,"date":"2025-05-11T08:49:42","date_gmt":"2025-05-11T00:49:42","guid":{"rendered":"https:\/\/www.idc.net\/help\/?p=441586"},"modified":"2025-05-11T08:49:42","modified_gmt":"2025-05-11T00:49:42","slug":"%e6%89%93%e9%80%a0%e7%82%ab%e9%85%b7%e7%bd%91%e9%a1%b5%e8%a7%86%e8%a7%89%e4%bd%93%e9%aa%8c%e7%9a%84css%e5%ae%9e%e7%94%a8%e6%8a%80%e5%b7%a7%e5%88%86%e4%ba%ab","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/441586\/","title":{"rendered":"\u6253\u9020\u70ab\u9177\u7f51\u9875\u89c6\u89c9\u4f53\u9a8c\u7684CSS\u5b9e\u7528\u6280\u5de7\u5206\u4eab"},"content":{"rendered":"<p>&nbsp;<\/p>\n<h2>\u4e00\u3001\u6e10\u53d8\u80cc\u666f\uff1a\u8ba9\u7f51\u9875\u7115\u53d1\u5149\u5f69<\/h2>\n<p>\u6e10\u53d8\u8272\u80cc\u666f\u65e9\u5df2\u6210\u4e3a\u73b0\u4ee3\u7f51\u9875\u8bbe\u8ba1\u7684\u8d8b\u52bf\uff0c\u80fd\u6253\u7834\u4f20\u7edf\u5355\u4e00\u80cc\u666f\u5e26\u6765\u7684\u89c6\u89c9\u75b2\u52b3\u3002<\/p>\n<pre><code class=\"language-css\">body {\r\n    background: linear-gradient(135deg, #74ebd5, #acb6e5);\r\n    height: 100vh;\r\n    margin: 0;\r\n    display: flex;\r\n    justify-content: center;\r\n    align-items: center;\r\n}\r\n<\/code><\/pre>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u4e3a\u9875\u9762\u521b\u5efa\u4e86\u659c\u5411\u6e10\u53d8\u6548\u679c\uff0c\u4ece\u6d45\u7eff\u8272\u8fc7\u6e21\u5230\u6de1\u84dd\u8272\uff0c\u9002\u5408\u7528\u4e8e\u79d1\u6280\u7c7b\u3001\u4f01\u4e1a\u5b98\u7f51\u7b49\u9700\u8981\u7a81\u51fa\u4e13\u4e1a\u5f62\u8c61\u7684\u7f51\u7ad9\u3002<\/p>\n<p>\u5bf9\u4e8e\u90e8\u7f72\u5728\u9999\u6e2f\u72ec\u7acb\u670d\u52a1\u5668\u4e0a\u7684\u7f51\u7ad9\uff0c\u8fd9\u79cd\u89c6\u89c9\u4f18\u5316\u6548\u679c\u4e0d\u4ec5\u7f8e\u89c2\uff0c\u4e5f\u80fd\u5728\u9ad8\u901f\u5e26\u5bbd\u652f\u6301\u4e0b\u5b8c\u7f8e\u5c55\u73b0\u3002<\/p>\n<hr \/>\n<h2>\u4e8c\u3001CSS\u52a8\u753b\uff1a\u8d4b\u4e88\u7f51\u9875\u751f\u547d\u529b<\/h2>\n<p>\u4f7f\u7528<code>@keyframes<\/code>\u5b9a\u4e49\u5173\u952e\u5e27\u52a8\u753b\uff0c\u53ef\u4ee5\u4e3a\u5143\u7d20\u6dfb\u52a0\u6e10\u53d8\u3001\u7f29\u653e\u3001\u65cb\u8f6c\u7b49\u52a8\u6001\u7279\u6548\u3002<\/p>\n<pre><code class=\"language-css\">@keyframes fadeIn {\r\n    from {\r\n        opacity: 0;\r\n        transform: translateY(20px);\r\n    }\r\n    to {\r\n        opacity: 1;\r\n        transform: translateY(0);\r\n    }\r\n}\r\n\r\nh1 {\r\n    animation: fadeIn 2s ease-in-out;\r\n}\r\n<\/code><\/pre>\n<p>\u6b64\u4ee3\u7801\u8ba9\u6807\u9898\u4ece\u4e0b\u65b9\u6ed1\u5165\uff0c\u5e76\u9010\u6e10\u53d8\u5f97\u6e05\u6670\u3002\u7528\u6237\u9996\u6b21\u52a0\u8f7d\u9875\u9762\u65f6\uff0c\u53ef\u4ee5\u83b7\u5f97\u66f4\u6709\u5438\u5f15\u529b\u7684\u89c6\u89c9\u611f\u53d7\u3002<\/p>\n<hr \/>\n<h2>\u4e09\u3001\u7acb\u4f53\u611f\u4ea4\u4e92\uff1a\u5b9e\u73b03D\u7ffb\u8f6c\u6548\u679c<\/h2>\n<p>\u901a\u8fc7CSS\u76843D\u53d8\u6362\u5c5e\u6027\uff0c\u53ef\u4ee5\u5236\u4f5c\u7ffb\u8f6c\u5361\u7247\uff0c\u8ba9\u4fe1\u606f\u5c55\u793a\u66f4\u5177\u4e92\u52a8\u6027\u3002<\/p>\n<pre><code class=\"language-html\">&lt;div class=\"card\"&gt;\r\n  &lt;div class=\"face front\"&gt;\u6b63\u9762&lt;\/div&gt;\r\n  &lt;div class=\"face back\"&gt;\u80cc\u9762&lt;\/div&gt;\r\n&lt;\/div&gt;\r\n<\/code><\/pre>\n<pre><code class=\"language-css\">.card {\r\n    width: 200px;\r\n    height: 300px;\r\n    perspective: 1000px;\r\n    transform-style: preserve-3d;\r\n    transition: transform 0.5s;\r\n}\r\n\r\n.card:hover {\r\n    transform: rotateY(180deg);\r\n}\r\n\r\n.face {\r\n    position: absolute;\r\n    width: 100%;\r\n    height: 100%;\r\n    backface-visibility: hidden;\r\n    display: flex;\r\n    justify-content: center;\r\n    align-items: center;\r\n}\r\n<\/code><\/pre>\n<p>\u8fd9\u79cd\u6548\u679c\u975e\u5e38\u9002\u5408\u5728\u90e8\u7f72\u4ea7\u54c1\u5c55\u793a\u9875\u65f6\u4f7f\u7528\uff0c\u642d\u914d\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u7684\u7a33\u5b9a\u5e26\u5bbd\u548c\u4f4e\u5ef6\u8fdf\uff0c\u80fd\u4e3a\u5ba2\u6237\u5e26\u6765\u6d41\u7545\u7684\u6d4f\u89c8\u4f53\u9a8c\u3002<\/p>\n<hr \/>\n<h2>\u56db\u3001\u6309\u94ae\u9634\u5f71\u4e0e\u5706\u89d2\u8bbe\u8ba1\uff1a\u63d0\u5347\u4ea4\u4e92\u7f8e\u611f<\/h2>\n<p>\u5706\u89d2\u6309\u94ae\u642d\u914d\u9634\u5f71\uff0c\u53ef\u589e\u5f3a\u7f51\u9875\u73b0\u4ee3\u611f\u3002<\/p>\n<pre><code class=\"language-css\">button {\r\n    border-radius: 8px;\r\n    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\r\n    transition: all 0.3s ease;\r\n}\r\n\r\nbutton:hover {\r\n    transform: translateY(-2px);\r\n    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);\r\n}\r\n<\/code><\/pre>\n<p>\u8fd9\u7c7b\u6309\u94ae\u7279\u522b\u9002\u5408\u7528\u4e8e\u6ce8\u518c\u3001\u767b\u5f55\u3001\u8d2d\u4e70\u7b49\u5173\u952e\u64cd\u4f5c\u533a\u57df\uff0c\u7ed3\u5408\u6211\u4eec\u9999\u6e2fvps\u670d\u52a1\u9ad8\u6027\u80fd\u4f4e\u65f6\u5ef6\u7684\u7279\u70b9\uff0c\u53ef\u4e3a\u4e1a\u52a1\u8f6c\u5316\u63d0\u4f9b\u575a\u5b9e\u4fdd\u969c\u3002<\/p>\n<hr \/>\n<h2>\u4e94\u3001\u56fe\u7247\u548c\u94fe\u63a5\u60ac\u505c\u6548\u679c\uff1a\u63d0\u5347\u4ea4\u4e92\u53cd\u9988<\/h2>\n<p>\u8ba9\u56fe\u7247\u5728\u60ac\u505c\u65f6\u6709\u8f7b\u5fae\u653e\u5927\uff0c\u53ef\u589e\u52a0\u89c6\u89c9\u5438\u5f15\u529b\uff1a<\/p>\n<pre><code class=\"language-css\">img:hover {\r\n    transform: scale(1.1);\r\n    transition: transform 0.3s ease;\r\n}\r\n<\/code><\/pre>\n<p>\u94fe\u63a5\u989c\u8272\u53d8\u6362\u793a\u4f8b\uff1a<\/p>\n<pre><code class=\"language-css\">a:hover {\r\n    color: #ff5722;\r\n}\r\n<\/code><\/pre>\n<p>\u8fd9\u79cd\u5c0f\u7ec6\u8282\u7684\u4f18\u5316\u5bf9\u4e8e\u63d0\u5347\u7528\u6237\u6d4f\u89c8\u8212\u9002\u5ea6\u5927\u6709\u88e8\u76ca\uff0c\u5c24\u5176\u9002\u7528\u4e8e\u90e8\u7f72\u5728\u9ad8\u8bbf\u95ee\u91cf\u9999\u6e2f\u670d\u52a1\u5668\u7684\u7535\u5546\u7c7b\u7f51\u7ad9\u3002<\/p>\n<hr \/>\n<h2>\u516d\u3001\u81ea\u5b9a\u4e49\u6eda\u52a8\u6761\uff1a\u6253\u9020\u4e13\u5c5e\u89c6\u89c9\u98ce\u683c<\/h2>\n<p>\u5b9a\u5236\u6eda\u52a8\u6761\u80fd\u8ba9\u4f60\u7684\u7f51\u7ad9\u66f4\u5177\u8bbe\u8ba1\u611f\u3002<\/p>\n<pre><code class=\"language-css\">::-webkit-scrollbar {\r\n    width: 10px;\r\n}\r\n::-webkit-scrollbar-track {\r\n    background: #f1f1f1;\r\n    border-radius: 10px;\r\n}\r\n::-webkit-scrollbar-thumb {\r\n    background: #888;\r\n    border-radius: 10px;\r\n}\r\n<\/code><\/pre>\n<p>\u9002\u5408\u7528\u4e8e\u5185\u5bb9\u4e30\u5bcc\u7684\u535a\u5ba2\u3001\u6587\u6863\u9875\u9762\uff0c\u63d0\u5347\u54c1\u724c\u89c6\u89c9\u4e00\u81f4\u6027\u3002<\/p>\n<hr \/>\n<h2>\u7ed3\u8bed\uff1a\u7528CSS\u4e3a\u7f51\u7ad9\u8d4b\u80fd\uff0c\u9009\u5bf9\u670d\u52a1\u5668\u662f\u5173\u952e<\/h2>\n<p>CSS\u662f\u4e00\u79cd\u517c\u5177\u7f8e\u89c2\u4e0e\u6027\u80fd\u4f18\u5316\u7684\u6280\u672f\u624b\u6bb5\uff0c\u80fd\u6781\u5927\u5730\u63d0\u5347\u7f51\u7ad9\u7684\u7528\u6237\u4f53\u9a8c\u3002\u800c\u8981\u8ba9\u8fd9\u4e9b\u89c6\u89c9\u7279\u6548\u5728\u7ec8\u7aef\u5b8c\u7f8e\u5448\u73b0\uff0c\u4e00\u4e2a\u5f3a\u5927\u800c\u7a33\u5b9a\u7684\u670d\u52a1\u5668\u73af\u5883\u4e0d\u53ef\u6216\u7f3a\u3002<\/p>\n<p>\u5982\u679c\u4f60\u6b63\u5728\u5bfb\u627e\u4f4e\u5ef6\u8fdf\u3001\u9ad8\u6027\u80fd\u3001\u9002\u914d\u4e9a\u6d32\u5730\u533a\u7528\u6237\u7684\u670d\u52a1\u5668\u65b9\u6848\uff0c\u63a8\u8350\u9009\u62e9<a href=\"https:\/\/idc.net\/\">\u9999\u6e2f\u670d\u52a1\u5668\u4ea7\u54c1<\/a>\uff0c\u65e0\u8bba\u662f<strong>\u9999\u6e2fvps<\/strong>\u3001<strong>\u9999\u6e2f\u4e91\u670d\u52a1\u5668<\/strong>\uff0c\u8fd8\u662f<strong>\u9999\u6e2f\u72ec\u7acb\u670d\u52a1\u5668<\/strong>\uff0c\u90fd\u53ef\u63d0\u4f9b\u4f18\u8d28\u7684\u7f51\u7edc\u8d44\u6e90\u548c\u9ad8\u53ef\u7528\u6027\u80fd\uff0c\u52a9\u529b\u4f60\u7684\u7f51\u9875\u6548\u679c\u987a\u5229\u5448\u73b0\uff0c\u63d0\u5347\u6574\u4f53\u7528\u6237\u4f53\u9a8c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; \u4e00\u3001\u6e10\u53d8\u80cc\u666f\uff1a\u8ba9\u7f51\u9875\u7115\u53d1\u5149\u5f69 \u6e10\u53d8\u8272\u80cc\u666f\u65e9\u5df2\u6210\u4e3a\u73b0\u4ee3\u7f51\u9875\u8bbe\u8ba1\u7684\u8d8b\u52bf\uff0c\u80fd\u6253\u7834\u4f20\u7edf\u5355\u4e00\u80cc\u666f\u5e26\u6765\u7684\u89c6\u89c9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[197854],"tags":[],"class_list":["post-441586","post","type-post","status-publish","format-standard","hentry","category-html"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/441586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=441586"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/441586\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=441586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=441586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=441586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}