{"id":238332,"date":"2023-12-26T05:50:19","date_gmt":"2023-12-25T21:50:19","guid":{"rendered":"https:\/\/www.idc.net\/help\/238332\/"},"modified":"2023-12-26T05:50:19","modified_gmt":"2023-12-25T21:50:19","slug":"css%e5%85%a5%e9%97%a8-background-repeat%ef%bc%88%e8%83%8c%e6%99%af%e5%9b%be%e7%89%87%e9%87%8d%e5%a4%8d%e6%96%b9%e5%bc%8f%ef%bc%89","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/238332\/","title":{"rendered":"Css\u5165\u95e8: background-repeat\uff08\u80cc\u666f\u56fe\u7247\u91cd\u590d\u65b9\u5f0f\uff09"},"content":{"rendered":"<p><title id=\"css%e5%85%a5%e9%97%a8-background-repeat%ef%bc%88%e8%83%8c%e6%99%af%e5%9b%be%e7%89%87%e9%87%8d%e5%a4%8d%e6%96%b9%e5%bc%8f%ef%bc%89-OGMaaxsHXg\">Css\u5165\u95e8: background-repeat\uff08\u80cc\u666f\u56fe\u7247\u91cd\u590d\u65b9\u5f0f\uff09<\/title><\/p>\n<h1 id=\"css%e5%85%a5%e9%97%a8-background-repeat%ef%bc%88%e8%83%8c%e6%99%af%e5%9b%be%e7%89%87%e9%87%8d%e5%a4%8d%e6%96%b9%e5%bc%8f%ef%bc%89-OGMaaxsHXg\">Css\u5165\u95e8: background-repeat\uff08\u80cc\u666f\u56fe\u7247\u91cd\u590d\u65b9\u5f0f\uff09<\/h1>\n<h2 id=\"%e8%83%8c%e6%99%af%e5%9b%be%e7%89%87%e9%87%8d%e5%a4%8d%e6%96%b9%e5%bc%8f-OGMaaxsHXg\">\u80cc\u666f\u56fe\u7247\u91cd\u590d\u65b9\u5f0f<\/h2>\n<p>CSS\u7684background-repeat\u5c5e\u6027\u7528\u4e8e\u63a7\u5236\u80cc\u666f\u56fe\u7247\u5728\u5143\u7d20\u4e2d\u7684\u91cd\u590d\u65b9\u5f0f\u3002\u901a\u8fc7\u8bbe\u7f6e\u4e0d\u540c\u7684\u5c5e\u6027\u503c\uff0c\u53ef\u4ee5\u5b9e\u73b0\u4e0d\u540c\u7684\u80cc\u666f\u56fe\u7247\u91cd\u590d\u6548\u679c\u3002<\/p>\n<h3 id=\"%e5%b1%9e%e6%80%a7%e5%80%bc-OGMaaxsHXg\">\u5c5e\u6027\u503c<\/h3>\n<p>background-repeat\u5c5e\u6027\u6709\u4ee5\u4e0b\u51e0\u4e2a\u5e38\u7528\u7684\u5c5e\u6027\u503c\uff1a<\/p>\n<ul>\n<li><strong>repeat<\/strong>: \u9ed8\u8ba4\u503c\uff0c\u80cc\u666f\u56fe\u7247\u5728\u6c34\u5e73\u548c\u5782\u76f4\u65b9\u5411\u4e0a\u5e73\u94fa\u91cd\u590d\u3002<\/li>\n<li><strong>repeat-x<\/strong>: \u80cc\u666f\u56fe\u7247\u5728\u6c34\u5e73\u65b9\u5411\u4e0a\u5e73\u94fa\u91cd\u590d\uff0c\u5782\u76f4\u65b9\u5411\u4e0a\u4e0d\u91cd\u590d\u3002<\/li>\n<li><strong>repeat-y<\/strong>: \u80cc\u666f\u56fe\u7247\u5728\u5782\u76f4\u65b9\u5411\u4e0a\u5e73\u94fa\u91cd\u590d\uff0c\u6c34\u5e73\u65b9\u5411\u4e0a\u4e0d\u91cd\u590d\u3002<\/li>\n<li><strong>no-repeat<\/strong>: \u80cc\u666f\u56fe\u7247\u4e0d\u91cd\u590d\uff0c\u53ea\u663e\u793a\u4e00\u6b21\u3002<\/li>\n<\/ul>\n<h3 id=\"%e7%a4%ba%e4%be%8b-OGMaaxsHXg\">\u793a\u4f8b<\/h3>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e9b\u4f7f\u7528background-repeat\u5c5e\u6027\u7684\u793a\u4f8b\uff1a<\/p>\n<h4 id=\"%e7%a4%ba%e4%be%8b1%ef%bc%9a-OGMaaxsHXg\">\u793a\u4f8b1\uff1a<\/h4>\n<p>HTML\u4ee3\u7801\uff1a<\/p>\n<pre><code>&lt;div class=\"example1\"&gt;&lt;\/div&gt;<\/code><\/pre>\n<p>CSS\u4ee3\u7801\uff1a<\/p>\n<pre><code>.example1 {\n  width: 200px;\n  height: 200px;\n  background-image: url(\"background.jpg\");\n  background-repeat: repeat;\n}<\/code><\/pre>\n<p>\u6548\u679c\uff1a\u80cc\u666f\u56fe\u7247\u5728\u5143\u7d20\u4e2d\u6c34\u5e73\u548c\u5782\u76f4\u65b9\u5411\u4e0a\u5e73\u94fa\u91cd\u590d\u3002<\/p>\n<h4 id=\"%e7%a4%ba%e4%be%8b2%ef%bc%9a-OGMaaxsHXg\">\u793a\u4f8b2\uff1a<\/h4>\n<p>HTML\u4ee3\u7801\uff1a<\/p>\n<pre><code>&lt;div class=\"example2\"&gt;&lt;\/div&gt;<\/code><\/pre>\n<p>CSS\u4ee3\u7801\uff1a<\/p>\n<pre><code>.example2 {\n  width: 200px;\n  height: 200px;\n  background-image: url(\"background.jpg\");\n  background-repeat: repeat-x;\n}<\/code><\/pre>\n<p>\u6548\u679c\uff1a\u80cc\u666f\u56fe\u7247\u5728\u5143\u7d20\u4e2d\u6c34\u5e73\u65b9\u5411\u4e0a\u5e73\u94fa\u91cd\u590d\uff0c\u5782\u76f4\u65b9\u5411\u4e0a\u4e0d\u91cd\u590d\u3002<\/p>\n<h4 id=\"%e7%a4%ba%e4%be%8b3%ef%bc%9a-OGMaaxsHXg\">\u793a\u4f8b3\uff1a<\/h4>\n<p>HTML\u4ee3\u7801\uff1a<\/p>\n<pre><code>&lt;div class=\"example3\"&gt;&lt;\/div&gt;<\/code><\/pre>\n<p>CSS\u4ee3\u7801\uff1a<\/p>\n<pre><code>.example3 {\n  width: 200px;\n  height: 200px;\n  background-image: url(\"background.jpg\");\n  background-repeat: repeat-y;\n}<\/code><\/pre>\n<p>\u6548\u679c\uff1a\u80cc\u666f\u56fe\u7247\u5728\u5143\u7d20\u4e2d\u5782\u76f4\u65b9\u5411\u4e0a\u5e73\u94fa\u91cd\u590d\uff0c\u6c34\u5e73\u65b9\u5411\u4e0a\u4e0d\u91cd\u590d\u3002<\/p>\n<h4 id=\"%e7%a4%ba%e4%be%8b4%ef%bc%9a-OGMaaxsHXg\">\u793a\u4f8b4\uff1a<\/h4>\n<p>HTML\u4ee3\u7801\uff1a<\/p>\n<pre><code>&lt;div class=\"example4\"&gt;&lt;\/div&gt;<\/code><\/pre>\n<p>CSS\u4ee3\u7801\uff1a<\/p>\n<pre><code>.example4 {\n  width: 200px;\n  height: 200px;\n  background-image: url(\"background.jpg\");\n  background-repeat: no-repeat;\n}<\/code><\/pre>\n<p>\u6548\u679c\uff1a\u80cc\u666f\u56fe\u7247\u4e0d\u91cd\u590d\uff0c\u53ea\u663e\u793a\u4e00\u6b21\u3002<\/p>\n<h2 id=\"%e6%80%bb%e7%bb%93-OGMaaxsHXg\">\u603b\u7ed3<\/h2>\n<p>\u901a\u8fc7CSS\u7684background-repeat\u5c5e\u6027\uff0c\u6211\u4eec\u53ef\u4ee5\u63a7\u5236\u80cc\u666f\u56fe\u7247\u5728\u5143\u7d20\u4e2d\u7684\u91cd\u590d\u65b9\u5f0f\u3002\u6839\u636e\u4e0d\u540c\u7684\u9700\u6c42\uff0c\u53ef\u4ee5\u9009\u62e9\u5408\u9002\u7684\u5c5e\u6027\u503c\u6765\u5b9e\u73b0\u4e0d\u540c\u7684\u80cc\u666f\u56fe\u7247\u91cd\u590d\u6548\u679c\u3002<\/p>\n<h2 id=\"%e9%a6%99%e6%b8%af%e6%9c%8d%e5%8a%a1%e5%99%a8%e9%a6%96%e9%80%89%e5%90%8e%e6%b5%aa%e4%ba%91-OGMaaxsHXg\">\u9999\u6e2f\u670d\u52a1\u5668\u9996\u9009\u540e\u6d6a\u4e91<\/h2>\n<p>\u540e\u6d6a\u4e91\u662f\u4e00\u5bb6\u4e13\u4e1a\u7684\u4e91\u8ba1\u7b97\u516c\u53f8\uff0c\u63d0\u4f9b\u9999\u6e2f\u670d\u52a1\u5668\u3001\u7f8e\u56fd\u670d\u52a1\u5668\u548c\u4e91\u670d\u52a1\u5668\u7b49\u4ea7\u54c1\u3002\u4f5c\u4e3a\u9999\u6e2f\u670d\u52a1\u5668\u7684\u9996\u9009\u54c1\u724c\uff0c\u540e\u6d6a\u4e91\u63d0\u4f9b\u7a33\u5b9a\u53ef\u9760\u7684\u670d\u52a1\u5668\u89e3\u51b3\u65b9\u6848\uff0c\u6ee1\u8db3\u7528\u6237\u7684\u4e0d\u540c\u9700\u6c42\u3002<\/p>\n<p>\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u540e\u6d6a\u4e91\u7684\u4fe1\u606f\uff0c\u8bf7\u8bbf\u95ee<a href=\"https:\/\/idc.net\">https:\/\/idc.net<\/a>\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Css\u5165\u95e8: background-repeat\uff08\u80cc\u666f\u56fe\u7247\u91cd\u590d\u65b9\u5f0f\uff09 Css\u5165\u95e8: background-re [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[197854],"tags":[],"class_list":["post-238332","post","type-post","status-publish","format-standard","hentry","category-html"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/238332","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=238332"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/238332\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=238332"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=238332"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=238332"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}