{"id":52747,"date":"2024-12-03T12:35:39","date_gmt":"2024-12-03T04:35:39","guid":{"rendered":"https:\/\/fwq.ai\/blog\/52747\/"},"modified":"2024-12-03T12:35:39","modified_gmt":"2024-12-03T04:35:39","slug":"%e5%a6%82%e4%bd%95%e7%94%a8-css-%e5%ae%9e%e7%8e%b0%e9%93%be%e6%8e%a5%e7%a7%bb%e5%85%a5%e6%95%88%e6%9e%9c%ef%bc%9f-3","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/52747\/","title":{"rendered":"\u5982\u4f55\u7528 CSS \u5b9e\u73b0\u94fe\u63a5\u79fb\u5165\u6548\u679c\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u5982\u4f55\u7528 CSS \u5b9e\u73b0\u94fe\u63a5\u79fb\u5165\u6548\u679c\uff1f<\/h1>\n<p>\u73cd\u60dc\u65f6\u95f4\uff0c\u52e4\u594b\u5b66\u4e60\uff01\u4eca\u5929\u7ed9\u5927\u5bb6\u5e26\u6765<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300a\u5982\u4f55\u7528 CSS \u5b9e\u73b0\u94fe\u63a5\u79fb\u5165\u6548\u679c\uff1f\u300b<\/span>\uff0c\u6b63\u6587\u5185\u5bb9\u4e3b\u8981\u6d89\u53ca\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\uff0c\u5982\u679c\u4f60\u6b63\u5728\u5b66\u4e60<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\uff0c\u6216\u8005\u662f\u5bf9<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u6709\u7591\u95ee\uff0c\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u6211\uff01\u540e\u9762\u6211\u4f1a\u6301\u7eed\u66f4\u65b0\u76f8\u5173\u5185\u5bb9\u7684\uff0c\u5e0c\u671b\u90fd\u80fd\u5e2e\u5230\u6b63\u5728\u5b66\u4e60\u7684\u5927\u5bb6\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241123\/17323256446741310ca931b.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u7528 CSS \u5b9e\u73b0\u94fe\u63a5\u79fb\u5165\u6548\u679c\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u7528 CSS \u5b9e\u73b0\u94fe\u63a5\u79fb\u5165\u6548\u679c\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>css \u4e2d\u5b9e\u73b0\u94fe\u63a5\u79fb\u5165\u6548\u679c\u7684\u6280\u5de7<\/strong><\/p>\n<p>\u5728 css \u4e2d\u6a21\u62df\u94fe\u63a5\u7684\u79fb\u5165\u6548\u679c\u53ef\u80fd\u5e76\u4e0d\u5bb9\u6613\uff0c\u56e0\u4e3a\u5b83\u4eec\u4e0d\u4f1a\u5f71\u54cd\u5468\u56f4\u5143\u7d20\u3002\u4f46\u662f\uff0c\u6709\u51e0\u4e2a\u65b9\u6cd5\u53ef\u4ee5\u5b9e\u73b0\u7c7b\u4f3c\u7684\u6548\u679c\uff1a<\/p>\n<p><strong>1. \u7f29\u653e<\/strong><\/p>\n<p>\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u662f\u4f7f\u7528 scale \u5c5e\u6027\uff0c\u5b83\u4f1a\u653e\u5927\u5143\u7d20\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff1a<\/p>\n<pre>.goods-item:hover {\n    scale: 1 1.05;\n}<\/pre>\n<p><strong>2. \u5e73\u79fb y \u8f74<\/strong><\/p>\n<p>\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u4f7f\u7528 transform \u5c5e\u6027\u4e2d\u7684 translatey \u503c\u3002\u8fd9\u4f1a\u6cbf y \u8f74\u79fb\u52a8\u5143\u7d20\uff0c\u4f7f\u5176\u770b\u8d77\u6765\u50cf\u6d6e\u52a8\u4e00\u6837\u3002<\/p>\n<pre>.goods-item:hover {\n    transform: translatey(-8px);\n}<\/pre>\n<p><strong>3. \u4f7f\u7528 translatey \u548c scale \u7ec4\u5408<\/strong><\/p>\n<p>\u4e3a\u4e86\u5b9e\u73b0\u66f4\u597d\u7684\u6548\u679c\uff0c\u53ef\u4ee5\u5c06 translatey \u548c scale \u7ed3\u5408\u8d77\u6765\u3002<\/p>\n<pre>.Goods-item:hover {\n    transform: scale(1, 1.05) translateY(-8px);\n}<\/pre>\n<p>\u4eca\u5929\u5173\u4e8e\u300a\u5982\u4f55\u7528 CSS \u5b9e\u73b0\u94fe\u63a5\u79fb\u5165\u6548\u679c\uff1f\u300b\u7684\u5185\u5bb9\u4ecb\u7ecd\u5c31\u5230\u6b64\u7ed3\u675f\uff0c\u5982\u679c\u6709\u4ec0\u4e48\u7591\u95ee\u6216\u8005\u5efa\u8bae\uff0c\u53ef\u4ee5\u5728\u7c73\u4e91\u516c\u4f17\u53f7\u4e0b\u591a\u591a\u56de\u590d\u4ea4\u6d41\uff1b\u6587\u4e2d\u82e5\u6709\u4e0d\u6b63\u4e4b\u5904\uff0c\u4e5f\u5e0c\u671b\u56de\u590d\u7559\u8a00\u4ee5\u544a\u77e5\uff01<\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   HTML \u548c Body \u80cc\u666f\u8272\u4f18\u5148\u7ea7\uff1a\u4e3a\u4ec0\u4e48 Body \u7684\u80cc\u666f\u8272\u4f1a\u5f71\u54cd\u6574\u4e2a\u6d4f\u89c8\u5668\uff1f\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u7528 CSS \u5b9e\u73b0\u94fe\u63a5\u79fb\u5165\u6548\u679c\uff1f \u73cd\u60dc\u65f6\u95f4\uff0c\u52e4\u594b\u5b66\u4e60\uff01\u4eca\u5929\u7ed9\u5927\u5bb6\u5e26\u6765\u300a\u5982\u4f55\u7528 CSS \u5b9e\u73b0\u94fe\u63a5\u79fb\u5165\u6548\u679c\uff1f\u300b\uff0c\u6b63\u6587\u5185\u5bb9\u4e3b\u8981\u6d89\u53ca\u5230\u7b49\u7b49\uff0c\u5982\u679c\u4f60\u6b63\u5728\u5b66\u4e60\u6587\u7ae0\uff0c\u6216\u8005\u662f\u5bf9\u6587\u7ae0\u6709\u7591\u95ee\uff0c\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u6211\uff01\u540e\u9762\u6211\u4f1a\u6301\u7eed\u66f4\u65b0\u76f8\u5173\u5185\u5bb9\u7684\uff0c\u5e0c\u671b\u90fd\u80fd\u5e2e\u5230\u6b63\u5728\u5b66\u4e60\u7684\u5927\u5bb6\uff01 css \u4e2d\u5b9e\u73b0\u94fe\u63a5\u79fb\u5165\u6548\u679c\u7684\u6280\u5de7 \u5728 css \u4e2d\u6a21\u62df\u94fe\u63a5\u7684\u79fb\u5165\u6548\u679c\u53ef\u80fd\u5e76\u4e0d\u5bb9\u6613\uff0c\u56e0\u4e3a\u5b83\u4eec\u4e0d\u4f1a\u5f71\u54cd\u5468\u56f4\u5143\u7d20\u3002\u4f46\u662f\uff0c\u6709\u51e0\u4e2a\u65b9\u6cd5\u53ef\u4ee5\u5b9e\u73b0\u7c7b\u4f3c\u7684\u6548\u679c\uff1a 1. \u7f29\u653e \u6700\u7b80\u5355\u7684\u65b9\u6cd5\u662f\u4f7f\u7528 scale \u5c5e\u6027\uff0c\u5b83\u4f1a\u653e\u5927\u5143\u7d20\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff1a .goods-item:hover { scale: 1 1.05; } 2. \u5e73\u79fb y \u8f74 \u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u4f7f\u7528 transform \u5c5e\u6027\u4e2d\u7684 translatey \u503c\u3002\u8fd9\u4f1a\u6cbf y \u8f74\u79fb\u52a8\u5143\u7d20\uff0c\u4f7f\u5176\u770b\u8d77\u6765\u50cf\u6d6e\u52a8\u4e00\u6837\u3002 .goods-item:hover { transform: translatey(-8px); } 3. \u4f7f\u7528 translatey \u548c scale \u7ec4\u5408 \u4e3a\u4e86\u5b9e\u73b0\u66f4\u597d\u7684\u6548\u679c\uff0c\u53ef\u4ee5\u5c06 translatey \u548c scale \u7ed3\u5408\u8d77\u6765\u3002 .Goods-item:hover { transform: scale(1, 1.05) translateY(-8px); [&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-52747","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52747","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=52747"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52747\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=52747"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=52747"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=52747"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}