{"id":27623,"date":"2024-11-24T14:56:49","date_gmt":"2024-11-24T06:56:49","guid":{"rendered":"https:\/\/fwq.ai\/blog\/27623\/"},"modified":"2024-11-24T14:56:49","modified_gmt":"2024-11-24T06:56:49","slug":"%e5%a6%82%e4%bd%95%e8%ae%a9-css-%e8%83%8c%e6%99%af%e5%9b%be%e7%89%87%e9%80%8f%e6%98%8e%e8%80%8c%e4%b8%8d%e5%bd%b1%e5%93%8d%e6%96%87%e5%ad%97%e5%8f%af%e8%a7%81%e5%ba%a6%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/27623\/","title":{"rendered":"\u5982\u4f55\u8ba9 CSS \u80cc\u666f\u56fe\u7247\u900f\u660e\u800c\u4e0d\u5f71\u54cd\u6587\u5b57\u53ef\u89c1\u5ea6\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173129815253712.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u8ba9 CSS \u80cc\u666f\u56fe\u7247\u900f\u660e\u800c\u4e0d\u5f71\u54cd\u6587\u5b57\u53ef\u89c1\u5ea6\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u8ba9 CSS \u80cc\u666f\u56fe\u7247\u900f\u660e\u800c\u4e0d\u5f71\u54cd\u6587\u5b57\u53ef\u89c1\u5ea6\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5728  \u4e2d\u8bbe\u7f6e\u80cc\u666f\u56fe\u7247\u7684\u900f\u660e\u5ea6\uff1f<\/strong><\/p>\n<p>\u95ee\u9898\u63cf\u8ff0\uff1a\u5982\u4f55\u4f7f\u7528 CSS \u8bbe\u7f6e\u80cc\u666f\u56fe\u7247\u7684\u900f\u660e\u5ea6\u800c\u4e0d\u4f1a\u5f71\u54cd\u6587\u5b57\u7684\u53ef\u89c1\u5ea6\uff1f\u4ee3\u7801\u793a\u4f8b\u5982\u4e0b\uff1a<\/p>\n<pre>&lt;div style=\"background-image: url('\/tmp\/2.png');\"&gt;\u6587\u5b57\u8981\u6e05\u6670\u53ef\u89c1&lt;\/div&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u7f51\u4e0a\u6d41\u884c\u7684\u505a\u6cd5\u662f\u4f7f\u7528 background-color: rgba(255, 255, 255, 0.5);\uff0c\u4f46\u5b9e\u9645\u4e0a\u5e76\u6ca1\u6709\u6548\u679c\u3002<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848\uff1a<\/strong><\/p>\n<p>\u4f7f\u7528\u4f2a\u5143\u7d20\u4ee3\u66ff\u80cc\u666f\u5c42\uff1a<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<pre>&lt;div class=\"wrap\"&gt;&lt;\/div&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<pre>.warp {\n  position: relative;\n}\n\n.warp:before {\n  position: absolute;\n  content: \"\";\n  opacity: 0.6; \/* \u900f\u660e\u5ea6 *\/\n  background-image: url('xxxx');\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u8ba9 CSS \u80cc\u666f\u56fe\u7247\u900f\u660e\u800c\u4e0d\u5f71\u54cd\u6587\u5b57\u53ef\u89c1\u5ea6\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>\u5982\u4f55\u5728 \u4e2d\u8bbe\u7f6e\u80cc\u666f\u56fe\u7247\u7684\u900f\u660e\u5ea6\uff1f \u95ee\u9898\u63cf\u8ff0\uff1a\u5982\u4f55\u4f7f\u7528 CSS \u8bbe\u7f6e\u80cc\u666f\u56fe\u7247\u7684\u900f\u660e\u5ea6\u800c\u4e0d\u4f1a\u5f71\u54cd\u6587\u5b57\u7684\u53ef\u89c1\u5ea6\uff1f\u4ee3\u7801\u793a\u4f8b\u5982\u4e0b\uff1a &lt;div style=&#8221;background-image: url(&#8216;\/tmp\/2.png&#8217;);&#8221;&gt;\u6587\u5b57\u8981\u6e05\u6670\u53ef\u89c1&lt;\/div&gt; \u767b\u5f55\u540e\u590d\u5236 \u7f51\u4e0a\u6d41\u884c\u7684\u505a\u6cd5\u662f\u4f7f\u7528 background-color: rgba(255, 255, 255, 0.5);\uff0c\u4f46\u5b9e\u9645\u4e0a\u5e76\u6ca1\u6709\u6548\u679c\u3002 \u89e3\u51b3\u65b9\u6848\uff1a \u4f7f\u7528\u4f2a\u5143\u7d20\u4ee3\u66ff\u80cc\u666f\u5c42\uff1a \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b &lt;div class=&#8221;wrap&#8221;&gt;&lt;\/div&gt; \u767b\u5f55\u540e\u590d\u5236 .warp { position: relative; } .warp:before { position: absolute; content: &#8220;&#8221;; opacity: 0.6; \/* \u900f\u660e\u5ea6 *\/ background-image: url(&#8216;xxxx&#8217;); top: 0; left: 0; right: 0; bottom: 0; } \u767b\u5f55\u540e\u590d\u5236 \u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u8ba9 CSS \u80cc\u666f\u56fe\u7247\u900f\u660e\u800c\u4e0d\u5f71\u54cd\u6587\u5b57\u53ef\u89c1\u5ea6\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},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-27623","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27623","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=27623"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27623\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=27623"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=27623"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=27623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}