{"id":3074,"date":"2024-11-10T15:29:41","date_gmt":"2024-11-10T07:29:41","guid":{"rendered":"https:\/\/fwq.ai\/blog\/3074\/"},"modified":"2024-11-10T15:29:41","modified_gmt":"2024-11-10T07:29:41","slug":"%e5%a6%82%e4%bd%95%e9%80%9a%e8%bf%87-css-%e5%ae%9e%e7%8e%b0%e9%bc%a0%e6%a0%87%e7%a7%bb%e5%8a%a8%e6%97%b6%ef%bc%8c%e6%8c%87%e5%ae%9a%e5%8c%ba%e5%9f%9f%e6%98%be%e7%a4%ba%e4%b8%8b%e5%b1%82%e5%9b%be","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/3074\/","title":{"rendered":"\u5982\u4f55\u901a\u8fc7 CSS \u5b9e\u73b0\u9f20\u6807\u79fb\u52a8\u65f6\uff0c\u6307\u5b9a\u533a\u57df\u663e\u793a\u4e0b\u5c42\u56fe\u7247\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173098638422971.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u901a\u8fc7 CSS \u5b9e\u73b0\u9f20\u6807\u79fb\u52a8\u65f6\uff0c\u6307\u5b9a\u533a\u57df\u663e\u793a\u4e0b\u5c42\u56fe\u7247\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u901a\u8fc7 CSS \u5b9e\u73b0\u9f20\u6807\u79fb\u52a8\u65f6\uff0c\u6307\u5b9a\u533a\u57df\u663e\u793a\u4e0b\u5c42\u56fe\u7247\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u53cc\u56fe\u91cd\u53e0\uff0c\u9f20\u6807\u79fb\u52a8\u65f6\u6307\u5b9a\u533a\u57df\u663e\u793a\u4e0b\u5c42\u56fe\u7247<\/strong><\/p>\n<p><strong>\u95ee\u9898\uff1a<\/strong>\u5982\u4f55\u53e0\u52a0\u4e24\u5f20\u56fe\u7247\uff0c\u4f7f\u5f97\u9f20\u6807\u79fb\u52a8\u65f6\uff0c\u6307\u5b9a\u533a\u57df\u8ddf\u8e2a\u9f20\u6807\u5e76\u663e\u793a\u4e0b\u5c42\u56fe\u7247\u5185\u5bb9\uff1f<\/p>\n<p><strong>\u56fe\u7247\uff1a<\/strong><\/p>\n<ul>\n<li>\u56fe\u7247 1\uff1a<\/li>\n<li>\u56fe\u7247 2\uff1a<\/li>\n<\/ul>\n<p><strong>\u671f\u671b\u6548\u679c\uff1a<\/strong><\/p>\n<p>\u9f20\u6807\u79fb\u52a8\u65f6\uff0c\u692d\u5706\u533a\u57df\u663e\u793a\u7b2c\u4e8c\u5f20\u56fe\u7247\u7684\u5185\u5bb9\u3002<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848\uff1a<\/strong><\/p>\n<pre>&lt;!-- HTML --&gt;\n&lt;div id=\"container\"&gt;\n  @@##@@\n  @@##@@\n&lt;\/div&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<pre>\/* CSS *\/\n#container {\n  position: relative;\n  width: 300px;\n  height: 300px;\n}\n\n#image1 {\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n}\n\n#image2 {\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n  -webkit-mask-image: url(\"mask.png\");\n  mask-image: url(\"mask.png\");\n  -webkit-mask-repeat: no-repeat;\n  mask-repeat: no-repeat;\n  -webkit-mask-size: 100% 100%;\n  mask-size: 100% 100%;\n  -webkit-transition: all 0.2s ease-in-out;\n  transition: all 0.2s ease-in-out;\n}\n\n#container:hover #image2 {\n  display: block;\n  -webkit-mask-position: center;\n  mask-position: center;\n}\n\n\/* \u692d\u5706\u906e\u7f69\u56fe\u7247 *\/\n.mask {\n  width: 100px;\n  height: 100px;\n  background: radial-gradient(circle, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u63d0\u793a\uff1a<\/strong><\/p>\n<ul>\n<li>\u8bf7\u786e\u4fdd mask.png \u662f\u4e00\u4e2a\u692d\u5706\u5f62\u72b6\u7684\u900f\u660e PNG \u6587\u4ef6\u3002<\/li>\n<li>\u6839\u636e\u9700\u8981\u8c03\u6574 mask-size \u548c -webkit-mask-position \u4ee5\u66f4\u6539\u692d\u5706\u7684\u5927\u5c0f\u548c\u4f4d\u7f6e\u3002<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.php.cn\/faq\/image1.png\" class=\"aligncenter\" title=\"\u5982\u4f55\u901a\u8fc7 CSS \u5b9e\u73b0\u9f20\u6807\u79fb\u52a8\u65f6\uff0c\u6307\u5b9a\u533a\u57df\u663e\u793a\u4e0b\u5c42\u56fe\u7247\uff1f\u63d2\u56fe1\" alt=\"\u5982\u4f55\u901a\u8fc7 CSS \u5b9e\u73b0\u9f20\u6807\u79fb\u52a8\u65f6\uff0c\u6307\u5b9a\u533a\u57df\u663e\u793a\u4e0b\u5c42\u56fe\u7247\uff1f\u63d2\u56fe1\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/www.php.cn\/faq\/image2.png\" class=\"aligncenter\" title=\"\u5982\u4f55\u901a\u8fc7 CSS \u5b9e\u73b0\u9f20\u6807\u79fb\u52a8\u65f6\uff0c\u6307\u5b9a\u533a\u57df\u663e\u793a\u4e0b\u5c42\u56fe\u7247\uff1f\u63d2\u56fe2\" alt=\"\u5982\u4f55\u901a\u8fc7 CSS \u5b9e\u73b0\u9f20\u6807\u79fb\u52a8\u65f6\uff0c\u6307\u5b9a\u533a\u57df\u663e\u793a\u4e0b\u5c42\u56fe\u7247\uff1f\u63d2\u56fe2\" \/> <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u901a\u8fc7 CSS \u5b9e\u73b0\u9f20\u6807\u79fb\u52a8\u65f6\uff0c\u6307\u5b9a\u533a\u57df\u663e\u793a\u4e0b\u5c42\u56fe\u7247\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53cc\u56fe\u91cd\u53e0\uff0c\u9f20\u6807\u79fb\u52a8\u65f6\u6307\u5b9a\u533a\u57df\u663e\u793a\u4e0b\u5c42\u56fe\u7247 \u95ee\u9898\uff1a\u5982\u4f55\u53e0\u52a0\u4e24\u5f20\u56fe\u7247\uff0c\u4f7f\u5f97\u9f20\u6807\u79fb\u52a8\u65f6\uff0c\u6307\u5b9a\u533a\u57df\u8ddf\u8e2a\u9f20\u6807\u5e76\u663e\u793a\u4e0b\u5c42\u56fe\u7247\u5185\u5bb9\uff1f \u56fe\u7247\uff1a \u56fe\u7247 1\uff1a \u56fe\u7247 2\uff1a \u671f\u671b\u6548\u679c\uff1a \u9f20\u6807\u79fb\u52a8\u65f6\uff0c\u692d\u5706\u533a\u57df\u663e\u793a\u7b2c\u4e8c\u5f20\u56fe\u7247\u7684\u5185\u5bb9\u3002 \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u89e3\u51b3\u65b9\u6848\uff1a &lt;!&#8211; HTML &#8211;&gt; &lt;div id=&#8221;container&#8221;&gt; @@##@@ @@##@@ &lt;\/div&gt; \u767b\u5f55\u540e\u590d\u5236 \/* CSS *\/ #container { position: relative; width: 300px; height: 300px; } #image1 { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } #image2 { position: absolute; top: 0; left: 0; width: 100%; [&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-3074","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/3074","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=3074"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/3074\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=3074"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=3074"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=3074"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}