{"id":727,"date":"2010-04-04T23:51:15","date_gmt":"2010-04-04T15:51:15","guid":{"rendered":"http:\/\/www.zhangxinxu.com\/wordpress\/?p=727"},"modified":"2018-07-29T21:52:11","modified_gmt":"2018-07-29T13:52:11","slug":"css%e6%b8%90%e5%8f%98%e4%b9%8bcss3-gradient%e5%9c%a8firefox3-6%e4%b8%8b%e7%9a%84%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/www.zhangxinxu.com\/wordpress\/2010\/04\/css%e6%b8%90%e5%8f%98%e4%b9%8bcss3-gradient%e5%9c%a8firefox3-6%e4%b8%8b%e7%9a%84%e4%bd%bf%e7%94%a8\/","title":{"rendered":"CSS\u6e10\u53d8\u4e4bCSS3 gradient\u5728Firefox3.6\u4e0b\u7684\u4f7f\u7528"},"content":{"rendered":"<p>by <a href=\"http:\/\/www.zhangxinxu.com\/\">zhangxinxu<\/a> from <a href=\"http:\/\/www.zhangxinxu.com\/\">http:\/\/www.zhangxinxu.com<\/a><br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=727\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=727<\/a><\/p>\n<div id=\"link\">\n\u539f\u6587\u5730\u5740\uff1a<a target=\"_blank\" href=\"http:\/\/hacks.mozilla.org\/2009\/11\/css-gradients-firefox-36\/\">http:\/\/hacks.mozilla.org\/2009\/11\/css-gradients-firefox-36\/<\/a><br \/>\n\u539f\u6587\u4f5c\u8005\uff1a<a target=\"_blank\" href=\"http:\/\/blogmag.net\/blog\/alix\">Alix Franquet<\/a><br \/>\n\u7ffb\u8bd1\u4f5c\u8005\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/\">\u5f20\u946b\u65ed<\/a>\n<\/div>\n<h3>\u4e00\u3001\u5f15\u5b50<\/h3>\n<p>Firefox3.6\u5305\u542b\u4e86\u8bb8\u591aCSS\u7684\u6539\u8fdb\uff0c\u672c\u6587\u5c06\u5411\u60a8\u5c55\u793a\u5982\u679c\u4f7f\u7528CSS\u6e10\u53d8\u3002<\/p>\n<p>\u5982\u679c\u4f60\u6b63\u5728\u8fd0\u884c\u7684Firefox 3.6\u7684\u6700\u65b0\u6d4b\u8bd5\u7248\uff0c\u4f60\u5e94\u8be5\u770b\u770b\u6211\u4eec\u7684<a title=\"CSS\u6e10\u53d8\u6548\u679c\u6f14\u793a \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" href=\"http:\/\/demos.hacks.mozilla.org\/openweb\/cssBackground\/gradients\/\">\u4e92\u52a8\u6f14\u793a<\/a>\uff0c\u5e76\u67e5\u770b\u76f8\u5e94\u7684\u4ee3\u7801\u3002\u4f7f\u7528\u5355\u9009\u6309\u94ae\u6765\u5207\u6362\u4e0d\u540c\u7684\u6837\u5f0f\u9009\u9879\u3002<br \/><img loading=\"lazy\" decoding=\"async\" class=\"mt5\" title=\"demo\u9875\u9762\u6837\u5f0f\u5207\u6362\u793a\u610f \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" alt=\"demo\u9875\u9762\u6837\u5f0f\u5207\u6362\u793a\u610f \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201004\/2010-04-04_213456.png\" width=\"572\" height=\"142\" \/><\/p>\n<h3>\u4e8c\u3001\u542bCSS\u6e10\u53d8\u7684\u80cc\u666f(backgrounds)<\/h3>\n<p>\u80cc\u666f\u4f7f\u7528CSS\u6e10\u53d8\u663e\u793a\u53ef\u4ee5\u4e0d\u4f7f\u7528\u56fe\u50cf\u5c31\u5b9e\u73b0\u4e24\u4e2a\u6216\u4e24\u4e2a\u4ee5\u4e0a\u7684\u6307\u5b9a\u989c\u8272\u7684\u5e73\u6ed1\u8fc7\u6e21\u3002\u8fd9\u53cd\u8fc7\u6765\u53c8\u51cf\u5c11\u4e86\u4e0b\u8f7d\u65f6\u95f4\u548c\u5e26\u5bbd\u7684\u4f7f\u7528\uff0c\u653e\u5927\u65f6\u4e5f\u6bd4\u8f83\u597d\u770b\uff0c\u53ef\u4ee5\u8ba9\u60a8\u521b\u9020\u51fa\u4e00\u4e2a\u66f4\u7075\u6d3b\u7684\u5e03\u5c40\u3002<\/p>\n<p>Firefox\u652f\u6301\u4e24\u79cd\u7c7b\u578b\u7684CSS\u6e10\u53d8\uff1a\u7ebf\u6027\u7684(<a href=\"https:\/\/developer.mozilla.org\/en\/CSS\/-moz-linear-gradient\">-moz-linear-gradient<\/a>)\u548c\u653e\u5c04\u72b6\u7684(<a href=\"https:\/\/developer.mozilla.org\/en\/CSS\/-moz-radial-gradient\">-moz-radial-gradient<\/a>)\u3002<\/p>\n<h3>\u4e09\u3001\u7ebf\u6027\u6e10\u53d8(Linear Gradients)<\/h3>\n<p>\u8981\u521b\u5efa\u4e00\u4e2a<a href=\"https:\/\/developer.mozilla.org\/en\/CSS\/-moz-linear-gradient\">\u7ebf\u6027\u6e10\u53d8<\/a>\uff0c\u60a8\u9700\u8981\u8bbe\u7f6e\u4e00\u4e2a\u8d77\u70b9\u548c\u4e00\u4e2a\u6e10\u53d8\u7684\u65b9\u5411\uff08\u6216\u89d2\u5ea6\uff09\uff0c\u5e76\u5b9a\u4e49\u8d77\u6b62\u989c\u8272\u3002<\/p>\n<div class=\"zxx_code\">\n<pre style=\"font-family: monospace;\"> -moz-linear-gradient<span style=\"color:rgb(0, 170, 0);\">(<\/span> <span style=\"color:rgb(0, 170, 0);\">[<\/span>&lt;point<span style=\"color:rgb(0, 170, 0);\">&gt;<\/span> || &lt;angle<span style=\"color:rgb(0, 170, 0);\">&gt;,<\/span><span style=\"color:rgb(0, 170, 0);\">]<\/span>? &lt;stop<span style=\"color:rgb(0, 170, 0);\">&gt;,<\/span> &lt;stop<span style=\"color:rgb(0, 170, 0);\">&gt;<\/span> <span style=\"color:rgb(0, 170, 0);\">[<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> &lt;stop<span style=\"color:rgb(0, 170, 0);\">&gt;<\/span><span style=\"color:rgb(0, 170, 0);\">]<\/span><span style=\"color:rgb(0, 170, 0);\">*<\/span> <span style=\"color:rgb(0, 170, 0);\">)<\/span><\/pre>\n<\/div>\n<p><strong>\u8d77\u59cb\u70b9(Starting Point)\uff1a<\/strong>\u8d77\u70b9\u7684\u5de5\u4f5c\u65b9\u5f0f\u7c7b\u4f3c\u4e8e<a href=\"http:\/\/www.w3.org\/TR\/css3-background\/#the-background-position\">background position<\/a>\u3002\u60a8\u53ef\u4ee5\u8bbe\u7f6e\u6c34\u5e73\u548c\u5782\u76f4\u4f4d\u7f6e\u4e3a\u767e\u5206\u6bd4\uff0c\u6216\u4ee5\u50cf\u7d20\u4e3a\u5355\u4f4d\uff0c\u6216\u5728\u6c34\u5e73\u65b9\u5411\u4e0a\u53ef\u4ee5\u4f7f\u7528left\/center\/right\uff0c\u5728\u5782\u76f4\u65b9\u5411\u4e0a\u53ef\u4ee5\u4f7f\u7528top\/center\/bottom\u3002\u4f4d\u7f6e\u8d77\u59cb\u4e8e\u5de6\u4e0a\u89d2\u3002\u5982\u679c\u4f60\u4e0d\u6307\u5b9a\u6c34\u5e73\u6216\u5782\u76f4\u4f4d\u7f6e\uff0c\u5b83\u5c06\u9ed8\u8ba4\u4e3acenter\u3002<\/p>\n<p>\u4f8b\u5982\uff0c\u8fd9\u91cc\u662f\u4e00\u4e2a\u7ebf\u6027\u6e10\u53d8\uff0c\u5f00\u59cb\u4e8ecenter\uff08\u6c34\u5e73\u53d1\u73b0\uff09\u548ctop\uff08\u5782\u76f4\u53d1\u73b0\uff09\uff0c\u5e76\u4ece\u84dd\u8272\u5230\u767d\u8272\u3002<\/p>\n<div><img loading=\"lazy\" decoding=\"async\" width=\"116\" height=\"116\" alt=\"Firefox CSS\u6e10\u53d8 basic_linear_bluetop \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/blog.mozilla.org\/hacks\/files\/2009\/11\/basic_linear_bluetop.png\" title=\"Firefox CSS\u84dd\u767d\u7ebf\u6027\u6e10\u53d8 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\"><\/div>\n<p>\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre style=\"font-family: monospace;\" class=\"css\"><span style=\"color:rgb(102, 102, 255);\">.linear_gradient_square<\/span> <span style=\"color:rgb(0, 170, 0);\">{<\/span>\n  <span style=\"color:rgb(0, 0, 0); font-weight: bold;\">width<\/span><span style=\"color:rgb(0, 170, 0);\">:<\/span> <span style=\"color:rgb(153, 51, 51);\">100px<\/span><span style=\"color:rgb(0, 170, 0);\">;<\/span>\n  <span style=\"color:rgb(0, 0, 0); font-weight: bold;\">height<\/span><span style=\"color:rgb(0, 170, 0);\">:<\/span> <span style=\"color:rgb(153, 51, 51);\">100px<\/span><span style=\"color:rgb(0, 170, 0);\">;<\/span>\n  <span style=\"color:rgb(0, 0, 0); font-weight: bold;\">border<\/span><span style=\"color:rgb(0, 170, 0);\">:<\/span> <span style=\"color:rgb(153, 51, 51);\">1px<\/span> <span style=\"color:rgb(153, 51, 51);\">solid<\/span> <span style=\"color:rgb(204, 0, 204);\">#333<\/span><span style=\"color:rgb(0, 170, 0);\">;<\/span>\n  <span style=\"color:rgb(0, 0, 0); font-weight: bold;\">background<\/span><span style=\"color:rgb(0, 170, 0);\">:<\/span> -moz-linear-gradient<span style=\"color:rgb(0, 170, 0);\">(<\/span><span style=\"color:rgb(0, 0, 0); font-weight: bold;\">top<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(0, 0, 0); font-weight: bold;\">blue<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(153, 51, 51);\">white<\/span><span style=\"color:rgb(0, 170, 0);\">)<\/span><span style=\"color:rgb(0, 170, 0);\">;<\/span>\n<span style=\"color:rgb(0, 170, 0);\">}<\/span><\/pre>\n<\/div>\n<p>\u6216\u8005\u662f\u8d77\u59cb\u4e8eleft\uff08\u6c34\u5e73\u65b9\u5411\uff09\u548ccenter\uff08\u5782\u76f4\u65b9\u5411\uff09<\/p>\n<div><img loading=\"lazy\" decoding=\"async\" width=\"111\" height=\"111\" alt=\"Firefox\u4e0b\u7684CSS\u84dd\u767d\u7ebf\u6027\u6e10\u53d8 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/blog.mozilla.org\/hacks\/files\/2009\/11\/basic_linear_blueleft.png\" title=\"Firefox\u4e0b\u7684CSS\u84dd\u767d\u7ebf\u6027\u6e10\u53d8 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\"><\/div>\n<p>\u4e3b\u8981\u90e8\u5206\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre style=\"font-family: monospace;\" class=\"css\"><span style=\"color:rgb(0, 0, 0); font-weight: bold;\">background<\/span><span style=\"color:rgb(0, 170, 0);\">:<\/span> -moz-linear-gradient<span style=\"color:rgb(0, 170, 0);\">(<\/span><span style=\"color:rgb(0, 0, 0); font-weight: bold;\">left<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(0, 0, 0); font-weight: bold;\">blue<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(153, 51, 51);\">white<\/span><span style=\"color:rgb(0, 170, 0);\">)<\/span><span style=\"color:rgb(0, 170, 0);\">;<\/span><\/pre>\n<\/div>\n<p>\u6216\u8005\u662f\u8d77\u59cb\u4e8eleft\uff08\u6c34\u5e73\u65b9\u5411\uff09\u548ctop\uff08\u5782\u76f4\u65b9\u5411\uff09<\/p>\n<div><img loading=\"lazy\" decoding=\"async\" width=\"109\" height=\"110\" alt=\"Firefox\u4e0b\u7684CSS\u84dd\u767d\u7ebf\u6027\u6e10\u53d8 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/blog.mozilla.org\/hacks\/files\/2009\/11\/basic_linear_bluetopleft.png\" title=\"Firefox\u4e0b\u7684CSS\u84dd\u767d\u7ebf\u6027\u6e10\u53d8 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\"><\/div>\n<p>\u4e3b\u8981\u90e8\u5206\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre style=\"font-family: monospace;\" class=\"css\"><span style=\"color:rgb(0, 0, 0); font-weight: bold;\">background<\/span><span style=\"color:rgb(0, 170, 0);\">:<\/span> -moz-linear-gradient<span style=\"color:rgb(0, 170, 0);\">(<\/span><span style=\"color:rgb(0, 0, 0); font-weight: bold;\">left<\/span> <span style=\"color:rgb(0, 0, 0); font-weight: bold;\">top<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(0, 0, 0); font-weight: bold;\">blue<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(153, 51, 51);\">white<\/span><span style=\"color:rgb(0, 170, 0);\">)<\/span><span style=\"color:rgb(0, 170, 0);\">;<\/span><\/pre>\n<\/div>\n<p><strong>\u89d2\u5ea6(Angle)\uff1a<\/strong>\u6b63\u5982\u60a8\u5728\u4e0a\u9762\u770b\u5230\u7684\uff0c\u5982\u679c\u60a8\u4e0d\u6307\u5b9a\u4e00\u4e2a\u89d2\u5ea6\uff0c\u5b83\u4f1a\u6839\u636e\u8d77\u59cb\u4f4d\u7f6e\u81ea\u52a8\u5b9a\u4e49\u3002\u5982\u679c\u4f60\u60f3\u66f4\u591a\u7684\u63a7\u5236\u6e10\u53d8\u7684\u65b9\u5411\uff0c\u60a8\u4e0d\u59a8\u8bbe\u7f6e<a href=\"http:\/\/www.w3.org\/TR\/css3-values\/#angles\">\u89d2\u5ea6<\/a>\u8bd5\u8bd5\u3002<\/p>\n<p>\u4f8b\u5982\uff0c\u4e0b\u9762\u7684\u4e24\u4e2a\u6e10\u53d8\u5177\u6709\u76f8\u540c\u7684\u8d77\u70b9left center\uff0c\u4f46\u662f\u53f3\u624b\u8fb9\u7684\u6709\u4e00\u4e2a20\u5ea6\u7684\u89d2\u5ea6\u3002<\/p>\n<div><img loading=\"lazy\" decoding=\"async\" width=\"231\" height=\"119\" alt=\"Firefox\u4e0b\u7684CSS\u7ebf\u6027\u6e10\u53d8\u89d2\u5ea6 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/blog.mozilla.org\/hacks\/files\/2009\/11\/linear_gradient_angle.png\" title=\"Firefox\u4e0b\u7684CSS\u7ebf\u6027\u6e10\u53d8\u89d2\u5ea6 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\"><\/div>\n<p>\u540e\u9762\u4e00\u4e2a\u542b\u6709\u89d2\u5ea6\u7684\u6e10\u53d8\u6838\u5fc3\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre style=\"font-family: monospace;\" class=\"css\"><span style=\"color:rgb(0, 0, 0); font-weight: bold;\">background<\/span><span style=\"color:rgb(0, 170, 0);\">:<\/span> -moz-linear-gradient<span style=\"color:rgb(0, 170, 0);\">(<\/span><span style=\"color:rgb(0, 0, 0); font-weight: bold;\">left<\/span> 20deg<span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(0, 0, 0); font-weight: bold;\">black<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(153, 51, 51);\">white<\/span><span style=\"color:rgb(0, 170, 0);\">)<\/span><span style=\"color:rgb(0, 170, 0);\">;<\/span><\/pre>\n<\/div>\n<p>\u5f53\u6307\u5b9a\u7684\u89d2\u5ea6\uff0c\u8bf7\u8bb0\u4f4f\uff0c\u5b83\u662f\u4e00\u4e2a\u7531\u6c34\u5e73\u7ebf\u4e0e\u6e10\u53d8\u7ebf\u4ea7\u751f\u7684\u7684\u89d2\u5ea6\uff0c\u9006\u65f6\u9488\u65b9\u5411\u3002\u56e0\u6b64\uff0c\u4f7f\u75280deg\u5c06\u4ea7\u751f\u4e00\u4e2a\u5de6\u5230\u53f3\u6a2a\u5411\u68af\u5ea6\uff0c\u800c90\u5ea6\u5c06\u521b\u5efa\u4e00\u4e2a\u4ece\u5e95\u90e8\u5230\u9876\u90e8\u7684\u5782\u76f4\u6e10\u53d8\u3002<\/p>\n<div><img loading=\"lazy\" decoding=\"async\" width=\"487\" height=\"124\" alt=\"Firefox\u4e0b\u7684CSS\u7ebf\u6027\u6e10\u53d8\u89d2\u5ea6 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/blog.mozilla.org\/hacks\/files\/2009\/11\/linear_redangles.png\" title=\"Firefox\u4e0b\u7684CSS\u7ebf\u6027\u6e10\u53d8\u89d2\u5ea6 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\"><\/div>\n<p>\u6838\u5fc3\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre style=\"font-family: monospace;\" class=\"css\">    <span style=\"color:rgb(0, 0, 0); font-weight: bold;\">background<\/span><span style=\"color:rgb(0, 170, 0);\">:<\/span> -moz-linear-gradient<span style=\"color:rgb(0, 170, 0);\">(<\/span>&lt;angle<span style=\"color:rgb(0, 170, 0);\">&gt;,<\/span> <span style=\"color:rgb(153, 51, 51);\">red<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(153, 51, 51);\">white<\/span><span style=\"color:rgb(0, 170, 0);\">)<\/span><span style=\"color:rgb(0, 170, 0);\">;<\/span><\/pre>\n<\/div>\n<p><strong>\u8d77\u6b62\u989c\u8272(Color Stops)\uff1a<\/strong>\u9664\u4e86\u8d77\u59cb\u4f4d\u7f6e\u548c\u89d2\u5ea6\uff0c\u4f60\u5e94\u8be5\u6307\u5b9a\u8d77\u6b62\u989c\u8272\u3002\u8d77\u6b62\u989c\u8272\u662f\u6cbf\u7740\u6e10\u53d8\u7ebf\uff0c\u5c06\u4f1a\u5728\u6307\u5b9a\u4f4d\u7f6e\uff08\u4ee5\u767e\u5206\u6bd4\u6216\u957f\u5ea6\u8bbe\u5b9a\uff09\u542b\u6709\u6307\u5b9a\u989c\u8272\u7684\u70b9\u3002\u8272\u5f69\u7684\u8d77\u6b62\u6570\u662f\u65e0\u9650\u7684\u3002\u5982\u679c\u60a8\u4f7f\u7528\u4e00\u4e2a\u767e\u5206\u6bd4\u4f4d\u7f6e\uff0c0\uff05\u4ee3\u8868\u8d77\u70b9\u548c100\uff05\u662f\u7ec8\u70b9\uff0c\u4f46\u533a\u57df\u5916\u7684\u503c\u53ef\u4ee5\u88ab\u7528\u6765\u8fbe\u5230\u9884\u671f\u7684\u6548\u679c\u3002<\/p>\n<p>\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff0c\u4e09\u4e2a\u8d77\u6b62\u989c\u8272\u3002\u56e0\u4e3a\u7b2c\u4e00\u4e2a\u548c\u6700\u540e\u7684\u989c\u8272\u5e76\u672a\u6307\u5b9a\u989c\u8272\u70b9\uff0c\u4ed6\u4eec\u5c06\u663e\u793a\u4e3a\u9ed8\u8ba4\u76840\uff05\u548c100\uff05\u3002<\/p>\n<div><img loading=\"lazy\" decoding=\"async\" width=\"108\" height=\"112\" alt=\"Firefox\u4e0b\u7684CSS\u7ebf\u6027\u6e10\u53d8\u4e4b\u8d77\u6b62\u989c\u8272 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/blog.mozilla.org\/hacks\/files\/2009\/11\/linear_colorstops1.png\" title=\"irefox\u4e0b\u7684CSS\u7ebf\u6027\u6e10\u53d8\u4e4b\u8d77\u6b62\u989c\u8272 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\"><\/div>\n<div class=\"zxx_code\">\n<pre style=\"font-family: monospace;\" class=\"css\"><span style=\"color:rgb(0, 0, 0); font-weight: bold;\">background<\/span><span style=\"color:rgb(0, 170, 0);\">:<\/span> -moz-linear-gradient<span style=\"color:rgb(0, 170, 0);\">(<\/span><span style=\"color:rgb(0, 0, 0); font-weight: bold;\">top<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(0, 0, 0); font-weight: bold;\">blue<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(153, 51, 51);\">white<\/span> <span style=\"color:rgb(153, 51, 51);\"><span style=\"color:rgb(204, 102, 204);\">80<\/span>%<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> orange<span style=\"color:rgb(0, 170, 0);\">)<\/span><span style=\"color:rgb(0, 170, 0);\">;<\/span><\/pre>\n<\/div>\n<p>\u5982\u679c\u6ca1\u6709\u6307\u5b9a\u4f4d\u7f6e\uff0c\u989c\u8272\u4f1a\u5747\u5300\u5206\u5e03\u3002<\/p>\n<div><img loading=\"lazy\" decoding=\"async\" width=\"113\" height=\"116\" alt=\"Firefox\u4e0b\u7684CSS\u7ebf\u6027\u6e10\u53d8\u4e4b\u5f69\u8679\u8272 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/blog.mozilla.org\/hacks\/files\/2009\/11\/linear_rainbow.png\" title=\"Firefox\u4e0b\u7684CSS\u7ebf\u6027\u6e10\u53d8\u4e4b\u5f69\u8679\u8272 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\"><\/div>\n<p>\u6838\u5fc3\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre style=\"font-family: monospace;\" class=\"css\"><span style=\"color:rgb(0, 0, 0); font-weight: bold;\">background<\/span><span style=\"color:rgb(0, 170, 0);\">:<\/span> -moz-linear-gradient<span style=\"color:rgb(0, 170, 0);\">(<\/span><span style=\"color:rgb(0, 0, 0); font-weight: bold;\">left<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(153, 51, 51);\">red<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> orange<span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(153, 51, 51);\">yellow<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(153, 51, 51);\">green<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(0, 0, 0); font-weight: bold;\">blue<\/span><span style=\"color:rgb(0, 170, 0);\">)<\/span><span style=\"color:rgb(0, 170, 0);\">;<\/span><\/pre>\n<\/div>\n<p><strong>\u900f\u660e\u5ea6(Transparency)\uff1a<\/strong>\u8fd8\u652f\u6301\u900f\u660e\u6e10\u53d8\u3002\u8fd9\u662f\u76f8\u5f53\u6709\u7528\u7684\uff0c\u4f8b\u5982\uff0c\u5f53\u5806\u53e0\u591a\u4e2a\u80cc\u666f\u65f6\u3002\u8fd9\u91cc\u662f\u4e24\u4e2a\u80cc\u666f\u7684\u7ed3\u5408\uff1a\u4e00\u5f20\u56fe\u7247\uff0c\u4e00\u4e2a\u767d\u8272\u5230\u900f\u660e\u7684\u7ebf\u6027\u6e10\u53d8\u3002<\/p>\n<div style=\"width:320px; overflow:hidden; font-size:0;\"><img loading=\"lazy\" decoding=\"async\" style=\"max-width:643px;\" width=\"643\" height=\"119\" alt=\"Firefox\u4e0b\u7684CSS\u7ebf\u6027\u6e10\u53d8\u4e4b\u900f\u660e\u5ea6\u6df7\u5408\u80cc\u666f \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/blog.mozilla.org\/hacks\/files\/2009\/11\/linear_multibg_transparent.png\" title=\"Firefox\u4e0b\u7684CSS\u7ebf\u6027\u6e10\u53d8\u4e4b\u900f\u660e\u5ea6\u6df7\u5408\u80cc\u666f \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\"><\/div>\n<div style=\"width:324px; overflow:hidden;\"><img loading=\"lazy\" decoding=\"async\" style=\"max-width:643px; margin-left:-330px;\" width=\"643\" height=\"119\" alt=\"Firefox\u4e0b\u7684CSS\u7ebf\u6027\u6e10\u53d8\u4e4b\u900f\u660e\u5ea6\u6df7\u5408\u80cc\u666f \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/blog.mozilla.org\/hacks\/files\/2009\/11\/linear_multibg_transparent.png\" title=\"Firefox\u4e0b\u7684CSS\u7ebf\u6027\u6e10\u53d8\u4e4b\u900f\u660e\u5ea6\u6df7\u5408\u80cc\u666f \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\"><\/div>\n<p>\u6838\u5fc3\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre style=\"font-family: monospace;\" class=\"css\"><span style=\"color:rgb(102, 102, 255);\">.multibackground_transparent<\/span> <span style=\"color:rgb(0, 170, 0);\">{<\/span>\n    <span style=\"color:rgb(0, 0, 0); font-weight: bold;\">background<\/span><span style=\"color:rgb(0, 170, 0);\">:<\/span> -moz-linear-gradient<span style=\"color:rgb(0, 170, 0);\">(<\/span><span style=\"color:rgb(0, 0, 0); font-weight: bold;\">right<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> rgba<span style=\"color:rgb(0, 170, 0);\">(<\/span>255<span style=\"color:rgb(0, 170, 0);\">,<\/span>255<span style=\"color:rgb(0, 170, 0);\">,<\/span>255<span style=\"color:rgb(0, 170, 0);\">,<\/span>0<span style=\"color:rgb(0, 170, 0);\">)<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> rgba<span style=\"color:rgb(0, 170, 0);\">(<\/span>255<span style=\"color:rgb(0, 170, 0);\">,<\/span>255<span style=\"color:rgb(0, 170, 0);\">,<\/span>255<span style=\"color:rgb(0, 170, 0);\">,<\/span>1<span style=\"color:rgb(0, 170, 0);\">)<\/span><span style=\"color:rgb(0, 170, 0);\">)<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(153, 51, 51);\">url<\/span><span style=\"color:rgb(0, 170, 0);\">(<\/span><span style=\"color:rgb(255, 0, 0); font-style: italic;\">http:\/\/demos.hacks.mozilla.org\/openweb\/resources\/images\/patterns\/flowers-pattern.jpg<\/span><span style=\"color:rgb(0, 170, 0);\">)<\/span><span style=\"color:rgb(0, 170, 0);\">;<\/span>\n<span style=\"color:rgb(0, 170, 0);\">}<\/span><\/pre>\n<\/div>\n<h3>\u56db\u3001\u5f84\u5411\u6e10\u53d8(Radial Gradients)<\/h3>\n<p>\u4e3a\u5f84\u5411\u6e10\u53d8\u7684\u8bed\u6cd5\u975e\u5e38\u7c7b\u4f3c\u4e8e\u7ebf\u6027\u6e10\u53d8\u3002<\/p>\n<div class=\"zxx_code\">\n<pre style=\"font-family: monospace;\" class=\"css\"> -moz-radial-gradient<span style=\"color:rgb(0, 170, 0);\">(<\/span><span style=\"color:rgb(0, 170, 0);\">[<\/span>&lt;bg-position<span style=\"color:rgb(0, 170, 0);\">&gt;<\/span> || &lt;angle<span style=\"color:rgb(0, 170, 0);\">&gt;,<\/span><span style=\"color:rgb(0, 170, 0);\">]<\/span>? <span style=\"color:rgb(0, 170, 0);\">[<\/span>&lt;shape<span style=\"color:rgb(0, 170, 0);\">&gt;<\/span> || &lt;size<span style=\"color:rgb(0, 170, 0);\">&gt;,<\/span><span style=\"color:rgb(0, 170, 0);\">]<\/span>? &lt;color-stop<span style=\"color:rgb(0, 170, 0);\">&gt;,<\/span> &lt;color-stop<span style=\"color:rgb(0, 170, 0);\">&gt;<\/span><span style=\"color:rgb(0, 170, 0);\">[<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> &lt;color-stop<span style=\"color:rgb(0, 170, 0);\">&gt;<\/span><span style=\"color:rgb(0, 170, 0);\">]<\/span><span style=\"color:rgb(0, 170, 0);\">*<\/span><span style=\"color:rgb(0, 170, 0);\">)<\/span><span style=\"color:rgb(0, 170, 0);\">;<\/span><\/pre>\n<\/div>\n<p>\u9664\u4e86\u60a8\u5df2\u7ecf\u5728\u7ebf\u6027\u6e10\u53d8\u4e2d\u770b\u5230\u7684\u8d77\u59cb\u4f4d\u7f6e\uff0c\u65b9\u5411\uff0c\u548c\u989c\u8272\uff0c\u5f84\u5411\u68af\u5ea6\u5141\u8bb8\u4f60\u6307\u5b9a\u6e10\u53d8\u7684\u5f62\u72b6\uff08\u5706\u5f62\u6216\u692d\u5706\u5f62\uff09\u548c\u5927\u5c0f\uff08\u6700\u8fd1\u7aef\uff0c\u6700\u8fd1\u89d2\uff0c\u6700\u8fdc\u7aef\uff0c\u6700\u8fdc\u89d2\uff0c\u5305\u542b\u6216\u8986\u76d6 (closest-side, closest-corner, farthest-side, farthest-corner, contain or cover)\uff09\u3002<\/p>\n<p><strong>\u989c\u8272\u8d77\u6b62(Color stops)\uff1a<\/strong>\u5c31\u50cf\u7528\u7ebf\u6027\u6e10\u53d8\uff0c\u4f60\u5e94\u8be5\u6cbf\u7740\u6e10\u53d8\u7ebf\u5b9a\u4e49\u6e10\u53d8\u7684\u8d77\u6b62\u989c\u8272\u3002\u4e0b\u9762\u7684\u5706\u5177\u6709\u76f8\u540c\u7684\u8d77\u6b62\u989c\u8272\uff0c\u4f46\u5728\u5de6\u8fb9\u7684\u4e3a\u9ed8\u8ba4\u7684\u989c\u8272\u95f4\u9694\u5747\u5300\u7684\u6e10\u53d8\uff0c\u800c\u53f3\u8fb9\u7684\u6bcf\u79cd\u989c\u8272\u90fd\u6709\u7279\u5b9a\u7684\u4f4d\u7f6e\u3002<\/p>\n<div><img loading=\"lazy\" decoding=\"async\" width=\"243\" height=\"115\" title=\"Firefox\u4e0b\u7684CSS\u5f84\u5411\u6e10\u53d8\u4e4b\u8d77\u6b62\u989c\u8272 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" alt=\"Firefox\u4e0b\u7684CSS\u5f84\u5411\u6e10\u53d8\u4e4b\u8d77\u6b62\u989c\u8272 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/blog.mozilla.org\/hacks\/files\/2009\/11\/radial_gradient_stop.png\"><\/div>\n<div class=\"zxx_code\">\n<pre style=\"font-family: monospace;\" class=\"css\"> <span style=\"color:rgb(0, 0, 0); font-weight: bold;\">background<\/span><span style=\"color:rgb(0, 170, 0);\">:<\/span> -moz-radial-gradient<span style=\"color:rgb(0, 170, 0);\">(<\/span><span style=\"color:rgb(153, 51, 51);\">red<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(153, 51, 51);\">yellow<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(204, 0, 204);\">#1E90FF<\/span><span style=\"color:rgb(0, 170, 0);\">)<\/span><span style=\"color:rgb(0, 170, 0);\">;<\/span>\n <span style=\"color:rgb(0, 0, 0); font-weight: bold;\">background<\/span><span style=\"color:rgb(0, 170, 0);\">:<\/span> -moz-radial-gradient<span style=\"color:rgb(0, 170, 0);\">(<\/span><span style=\"color:rgb(153, 51, 51);\">red<\/span> <span style=\"color:rgb(153, 51, 51);\"><span style=\"color:rgb(204, 102, 204);\">5<\/span>%<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(153, 51, 51);\">yellow<\/span> <span style=\"color:rgb(153, 51, 51);\"><span style=\"color:rgb(204, 102, 204);\">25<\/span>%<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(204, 0, 204);\">#1E90FF<\/span> <span style=\"color:rgb(153, 51, 51);\"><span style=\"color:rgb(204, 102, 204);\">50<\/span>%<\/span><span style=\"color:rgb(0, 170, 0);\">)<\/span><span style=\"color:rgb(0, 170, 0);\">;<\/span><\/pre>\n<\/div>\n<p><strong>\u5f62\u72b6(Shape)\uff1a<\/strong>\u5728\u8fd9\u91cc\u4f60\u53ef\u4ee5\u770b\u5230\u4e24\u4e2a\u53ef\u80fd\u7684\u5f62\u72b6\u95f4\u7684\u5dee\u5f02\uff0c\u4e00\u4e2a\u5706\uff08\u5de6\u4fa7\uff09\u548c\u692d\u5706\uff08\u53f3\u4fa7\uff09\uff0c\u4e24\u8005\u90fd\u8d77\u59cb\u4e8ebottom left\uff1a<\/p>\n<div><img loading=\"lazy\" decoding=\"async\" width=\"544\" height=\"116\" alt=\"Firefox\u4e0b\u7684CSS\u5f84\u5411\u6e10\u53d8\u4e4b\u5f62\u72b6 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/blog.mozilla.org\/hacks\/files\/2009\/11\/radial_circle_ellipse.png\" title=\"Firefox\u4e0b\u7684CSS\u5f84\u5411\u6e10\u53d8\u4e4b\u5f62\u72b6 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\"><\/div>\n<div class=\"zxx_code\">\n<pre style=\"font-family: monospace;\" class=\"css\"> <span style=\"color:rgb(102, 102, 255);\">.radial_gradient_circle<\/span> <span style=\"color:rgb(0, 170, 0);\">{<\/span>\n    <span style=\"color:rgb(0, 0, 0); font-weight: bold;\">background<\/span><span style=\"color:rgb(0, 170, 0);\">:<\/span> -moz-radial-gradient<span style=\"color:rgb(0, 170, 0);\">(<\/span><span style=\"color:rgb(0, 0, 0); font-weight: bold;\">bottom<\/span> <span style=\"color:rgb(0, 0, 0); font-weight: bold;\">left<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(153, 51, 51);\">circle<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(153, 51, 51);\">red<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(153, 51, 51);\">yellow<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(204, 0, 204);\">#1E90FF<\/span><span style=\"color:rgb(0, 170, 0);\">)<\/span><span style=\"color:rgb(0, 170, 0);\">;<\/span>\n<span style=\"color:rgb(0, 170, 0);\">}<\/span>\n <span style=\"color:rgb(102, 102, 255);\">.radial_gradient_ellipse<\/span> <span style=\"color:rgb(0, 170, 0);\">{<\/span>\n    <span style=\"color:rgb(0, 0, 0); font-weight: bold;\">background<\/span><span style=\"color:rgb(0, 170, 0);\">:<\/span> -moz-radial-gradient<span style=\"color:rgb(0, 170, 0);\">(<\/span><span style=\"color:rgb(0, 0, 0); font-weight: bold;\">bottom<\/span> <span style=\"color:rgb(0, 0, 0); font-weight: bold;\">left<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> ellipse<span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(153, 51, 51);\">red<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(153, 51, 51);\">yellow<\/span><span style=\"color:rgb(0, 170, 0);\">,<\/span> <span style=\"color:rgb(204, 0, 204);\">#1E90FF<\/span><span style=\"color:rgb(0, 170, 0);\">)<\/span><span style=\"color:rgb(0, 170, 0);\">;<\/span>\n<span style=\"color:rgb(0, 170, 0);\">}<\/span><\/pre>\n<\/div>\n<p><strong>\u5927\u5c0f(Size)\uff1a<\/strong>size\u7684\u4e0d\u540c\u9009\u9879(closest-side, closest-corner, farthest-side, farthest-corner, contain or cover)\u6307\u5411\u88ab\u7528\u6765\u5b9a\u4e49\u5706\u6216\u692d\u5706\u5927\u5c0f\u7684\u70b9\u3002<\/p>\n<p>\u793a\u4f8b\uff1a\u692d\u5706\u7684\u8fd1\u8fb9VS\u8fdc\u89d2<br \/>\u4e0b\u9762\u7684\u4e24\u4e2a\u692d\u5706\u6709\u4e0d\u540c\u7684\u5927\u5c0f\u3002\u5de6\u8fb9\u7684\u4e00\u4e2a\u662f\u7531\u4ece\u8d77\u59cb\u70b9(center)\u5230\u8fd1\u8fb9\u7684\u8ddd\u79bb\u8bbe\u5b9a\u7684\uff0c\u800c\u53f3\u8fb9\u7684\u4e00\u4e2a\u662f\u7531\u4ece\u8d77\u59cb\u70b9\u5230\u8fdc\u89d2\u7684\u7684\u8ddd\u79bb\u51b3\u5b9a\u7684\u3002<\/p>\n<div><img decoding=\"async\" width=\"500\" title=\"Firefox\u4e0b\u7684CSS\u5f84\u5411\u6e10\u53d8\u4e4b\u5927\u5c0f \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" alt=\"Firefox\u4e0b\u7684CSS\u5f84\u5411\u6e10\u53d8\u4e4b\u5927\u5c0f \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/blog.mozilla.org\/hacks\/files\/2009\/11\/radial_ellipse_size.png\"><\/div>\n<div class=\"zxx_code\">\n<pre style=\"font-family: monospace;\">  <span style=\"color: rgb(0, 0, 0); font-weight: bold;\">background<\/span><span style=\"color: rgb(0, 170, 0);\">:<\/span> -moz-radial-gradient<span style=\"color: rgb(0, 170, 0);\">(<\/span>ellipse closest-side<span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(153, 51, 51);\">red<\/span><span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(153, 51, 51);\">yellow<\/span> <span style=\"color: rgb(153, 51, 51);\"><span style=\"color: rgb(204, 102, 204);\">10<\/span>%<\/span><span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(204, 0, 204);\">#1E90FF<\/span> <span style=\"color: rgb(153, 51, 51);\"><span style=\"color: rgb(204, 102, 204);\">50<\/span>%<\/span><span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(153, 51, 51);\">white<\/span><span style=\"color: rgb(0, 170, 0);\">)<\/span><span style=\"color: rgb(0, 170, 0);\">;<\/span>\n  <span style=\"color: rgb(0, 0, 0); font-weight: bold;\">background<\/span><span style=\"color: rgb(0, 170, 0);\">:<\/span> -moz-radial-gradient<span style=\"color: rgb(0, 170, 0);\">(<\/span>ellipse farthest-corner<span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(153, 51, 51);\">red<\/span><span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(153, 51, 51);\">yellow<\/span> <span style=\"color: rgb(153, 51, 51);\"><span style=\"color: rgb(204, 102, 204);\">10<\/span>%<\/span><span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(204, 0, 204);\">#1E90FF<\/span> <span style=\"color: rgb(153, 51, 51);\"><span style=\"color: rgb(204, 102, 204);\">50<\/span>%<\/span><span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(153, 51, 51);\">white<\/span><span style=\"color: rgb(0, 170, 0);\">)<\/span><span style=\"color: rgb(0, 170, 0);\">;<\/span><\/pre>\n<\/div>\n<div><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201004\/2010-04-04_232619.png\" width=\"508\" height=\"172\" title=\"\u8fd1\u8fb9\u4e0e\u8fdc\u89d2\u7684\u793a\u610f \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" alt=\"\u8fd1\u8fb9\u4e0e\u8fdc\u89d2\u7684\u793a\u610f \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" \/><\/div>\n<p>\u793a\u4f8b\uff1a\u5706\u7684\u8fd1\u8fb9VS\u8fdc\u8fb9<br \/>\u5de6\u8fb9\u7684\u5706\u7684\u6e10\u53d8\u5927\u5c0f\u7531\u8d77\u59cb\u70b9(center)\u5230\u8fd1\u8fb9\u7684\u8ddd\u79bb\u51b3\u5b9a\uff0c\u800c\u53f3\u8fb9\u7684\u5706\u5219\u6709\u8d77\u59cb\u70b9\u5230\u8fdc\u8fb9\u7684\u8ddd\u79bb\u51b3\u5b9a\u3002<\/p>\n<div><img loading=\"lazy\" decoding=\"async\" width=\"541\" height=\"114\" title=\"Firefox\u4e0b\u7684CSS\u5f84\u5411\u6e10\u53d8\u4e4b\u5927\u5c0f \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" alt=\"Firefox\u4e0b\u7684CSS\u5f84\u5411\u6e10\u53d8\u4e4b\u5927\u5c0f\" src=\"http:\/\/blog.mozilla.org\/hacks\/files\/2009\/11\/radial_circle_size.png\"><\/div>\n<div class=\"zxx_code\">\n<pre style=\"font-family: monospace;\" class=\"css\"> <span style=\"color: rgb(0, 0, 0); font-weight: bold;\">background<\/span><span style=\"color: rgb(0, 170, 0);\">:<\/span> -moz-radial-gradient<span style=\"color: rgb(0, 170, 0);\">(<\/span><span style=\"color: rgb(153, 51, 51);\">circle<\/span> closest-side<span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(153, 51, 51);\">red<\/span><span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(153, 51, 51);\">yellow<\/span> <span style=\"color: rgb(153, 51, 51);\"><span style=\"color: rgb(204, 102, 204);\">10<\/span>%<\/span><span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(204, 0, 204);\">#1E90FF<\/span> <span style=\"color: rgb(153, 51, 51);\"><span style=\"color: rgb(204, 102, 204);\">50<\/span>%<\/span><span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(153, 51, 51);\">white<\/span><span style=\"color: rgb(0, 170, 0);\">)<\/span><span style=\"color: rgb(0, 170, 0);\">;<\/span>\n <span style=\"color: rgb(0, 0, 0); font-weight: bold;\">background<\/span><span style=\"color: rgb(0, 170, 0);\">:<\/span> -moz-radial-gradient<span style=\"color: rgb(0, 170, 0);\">(<\/span><span style=\"color: rgb(153, 51, 51);\">circle<\/span> farthest-side<span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(153, 51, 51);\">red<\/span><span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(153, 51, 51);\">yellow<\/span> <span style=\"color: rgb(153, 51, 51);\"><span style=\"color: rgb(204, 102, 204);\">10<\/span>%<\/span><span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(204, 0, 204);\">#1E90FF<\/span> <span style=\"color: rgb(153, 51, 51);\"><span style=\"color: rgb(204, 102, 204);\">50<\/span>%<\/span><span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(153, 51, 51);\">white<\/span><span style=\"color: rgb(0, 170, 0);\">)<\/span><span style=\"color: rgb(0, 170, 0);\">;<\/span><\/pre>\n<\/div>\n<p>\u793a\u4f8b\uff1a\u5305\u542b\u5706<br \/>\u5728\u8fd9\u91cc\u4f60\u53ef\u4ee5\u770b\u5230\u5de6\u4fa7\u7684\u9ed8\u8ba4\u5708\uff0c\u540c\u4e00\u6e10\u53d8\u7248\u672c\uff0c\u4f46\u662f\u88ab\u5305\u542b\u7684\u53f3\u8fb9\u7684\u5706\u3002<\/p>\n<div><img loading=\"lazy\" decoding=\"async\" width=\"241\" height=\"116\" alt=\"Firefox\u4e0b\u7684CSS\u5f84\u5411\u6e10\u53d8\u4e4b\u5927\u5c0f\u5305\u542b \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/blog.mozilla.org\/hacks\/files\/2009\/11\/radial_contain.png\" title=\"Firefox\u4e0b\u7684CSS\u5f84\u5411\u6e10\u53d8\u4e4b\u5927\u5c0f\u5305\u542b \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\"><\/div>\n<div class=\"zxx_code\">\n<pre style=\"font-family: monospace;\" class=\"css\"> <span style=\"color: rgb(0, 0, 0); font-weight: bold;\">background<\/span><span style=\"color: rgb(0, 170, 0);\">:<\/span> -moz-radial-gradient<span style=\"color: rgb(0, 170, 0);\">(<\/span><span style=\"color: rgb(153, 51, 51);\">red<\/span><span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(153, 51, 51);\">yellow<\/span><span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(204, 0, 204);\">#1E90FF<\/span><span style=\"color: rgb(0, 170, 0);\">)<\/span><span style=\"color: rgb(0, 170, 0);\">;<\/span>\n <span style=\"color: rgb(0, 0, 0); font-weight: bold;\">background<\/span><span style=\"color: rgb(0, 170, 0);\">:<\/span> -moz-radial-gradient<span style=\"color: rgb(0, 170, 0);\">(<\/span>contain<span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(153, 51, 51);\">red<\/span><span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(153, 51, 51);\">yellow<\/span><span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(204, 0, 204);\">#1E90FF<\/span><span style=\"color: rgb(0, 170, 0);\">)<\/span><span style=\"color: rgb(0, 170, 0);\">;<\/span><\/pre>\n<\/div>\n<h3>\u4e94\u3001\u91cd\u590d\u6e10\u53d8(Repeating Gradients)<\/h3>\n<p>\u5982\u679c\u60a8\u60f3\u91cd\u590d\u4e00\u4e2a\u6e10\u53d8\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528<a href=\"https:\/\/developer.mozilla.org\/en\/CSS\/-moz-repeating-linear-gradient\">-moz-repeating-linear-gradient<\/a>\u548c<a href=\"https:\/\/developer.mozilla.org\/en\/CSS\/-moz-repeating-radial-gradient\">-moz-repeating-radial-gradient<\/a>\u3002<\/p>\n<p>\u5728\u4e0b\u9762\u7684\u4f8b\u5b50\uff0c\u6bcf\u4e2a\u5b9e\u4f8b\u90fd\u6307\u5b9a\u4e86\u56db\u4e2a\u8d77\u6b62\u989c\u8272\uff0c\u5e76\u65e0\u9650\u91cd\u590d\u3002<\/p>\n<div><img loading=\"lazy\" decoding=\"async\" width=\"257\" height=\"117\" title=\"Firefox\u4e0b\u7684CSS\u91cd\u590d\u6e10\u53d8 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" alt=\"Firefox\u4e0b\u7684CSS\u91cd\u590d\u6e10\u53d8 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/blog.mozilla.org\/hacks\/files\/2009\/11\/repeating_gradients.png\"><\/div>\n<div class=\"zxx_code\">\n<pre style=\"font-family: monospace;\"> <span style=\"color: rgb(102, 102, 255);\">.repeating_radial_gradient_example<\/span> <span style=\"color: rgb(0, 170, 0);\">{<\/span>\n    <span style=\"color: rgb(0, 0, 0); font-weight: bold;\">background<\/span><span style=\"color: rgb(0, 170, 0);\">:<\/span> -moz-repeating-radial-gradient<span style=\"color: rgb(0, 170, 0);\">(<\/span><span style=\"color: rgb(0, 0, 0); font-weight: bold;\">black<\/span><span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(0, 0, 0); font-weight: bold;\">black<\/span> <span style=\"color: rgb(153, 51, 51);\">5px<\/span><span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(153, 51, 51);\">white<\/span> <span style=\"color: rgb(153, 51, 51);\">5px<\/span><span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(153, 51, 51);\">white<\/span> <span style=\"color: rgb(153, 51, 51);\">10px<\/span><span style=\"color: rgb(0, 170, 0);\">)<\/span><span style=\"color: rgb(0, 170, 0);\">;<\/span>\n<span style=\"color: rgb(0, 170, 0);\">}<\/span>\n <span style=\"color: rgb(102, 102, 255);\">.repeating_linear_gradient_example<\/span> <span style=\"color: rgb(0, 170, 0);\">{<\/span>\n     <span style=\"color: rgb(0, 0, 0); font-weight: bold;\">background<\/span><span style=\"color: rgb(0, 170, 0);\">:<\/span> -moz-repeating-linear-gradient<span style=\"color: rgb(0, 170, 0);\">(<\/span><span style=\"color: rgb(0, 0, 0); font-weight: bold;\">top<\/span> <span style=\"color: rgb(0, 0, 0); font-weight: bold;\">left<\/span> -45deg<span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(153, 51, 51);\">red<\/span><span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(153, 51, 51);\">red<\/span> <span style=\"color: rgb(153, 51, 51);\">5px<\/span><span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(153, 51, 51);\">white<\/span> <span style=\"color: rgb(153, 51, 51);\">5px<\/span><span style=\"color: rgb(0, 170, 0);\">,<\/span> <span style=\"color: rgb(153, 51, 51);\">white<\/span> <span style=\"color: rgb(153, 51, 51);\">10px<\/span><span style=\"color: rgb(0, 170, 0);\">)<\/span><span style=\"color: rgb(0, 170, 0);\">;<\/span>\n<span style=\"color: rgb(0, 170, 0);\">}<\/span><\/pre>\n<\/div>\n<p><strong>Demo<\/strong><br \/>\u60a8\u53ef\u4ee5\u67e5\u770b<a href=\"http:\/\/demos.hacks.mozilla.org\/openweb\/cssBackground\/gradients\/\">\u7ebf\u6027\u548c\u5f84\u5411\u6e10\u53d8demo<\/a>\u83b7\u53d6\u66f4\u591a\u793a\u4f8b<\/p>\n<h3>\u516d\u3001\u8bd1\u8005\u7684\u7ed3\u8bed<\/h3>\n<p>\u4ee5\u4e0a\u4e3a\u5168\u6587\u7684\u5168\u90e8\u5185\u5bb9\uff0c\u9664\u4e86\u6700\u540e\u4e00\u70b9\u70b9\u5173\u4e8e\u7248\u672c\u7684\u95ee\u9898\u6ca1\u6709\u7ffb\u8bd1\u5916\uff0c\u5176\u4f59\u5747\u5c3d\u91cf\u5982\u5b9e\u7ffb\u8bd1\uff0c\u5176\u4e2d\u4e3a\u4e86\u4fbf\u4e8e\u7406\u89e3\uff0c\u6211\u81ea\u5df1\u4e5f\u6dfb\u52a0\u4e86\u4e00\u4e9b\u56fe\u7247\u3002\u6700\u540e\uff0c\u672c\u4eba\u7ffb\u8bd1\u80fd\u529b\u6709\u9650\uff0c\u51fa\u73b0\u4e0d\u51c6\u786e\u5728\u6240\u96be\u514d\uff0c\u6b22\u8fce\u6307\u6b63\u3002<\/p>\n<p>\u672c\u6587\u4e3a\u539f\u521b\u6587\u7ae0\uff0c\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u6765\u81ea<a href=\"http:\/\/www.zhangxinxu.com\/\">\u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b<\/a>[<a href=\"http:\/\/www.zhangxinxu.com\/\">http:\/\/www.zhangxinxu.com<\/a>]<br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=727\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=727<\/a><\/p>\n<p>\uff08\u672c\u7bc7\u5b8c\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Firefox3.6\u5305\u542b\u4e86\u8bb8\u591aCSS\u7684\u6539\u8fdb\uff0c\u672c\u6587\u5c06\u5411\u60a8\u5c55\u793a\u5982\u679c\u4f7f\u7528CSS\u6e10\u53d8\u3002<br \/>\n\u80cc\u666f\u4f7f\u7528CSS\u6e10\u53d8\u663e\u793a\u53ef\u4ee5\u4e0d\u4f7f\u7528\u56fe\u50cf\u5c31\u5b9e\u73b0\u4e24\u4e2a\u6216\u4e24\u4e2a\u4ee5\u4e0a\u7684\u6307\u5b9a\u989c\u8272\u7684\u5e73\u6ed1\u8fc7\u6e21\u3002\u8fd9\u53cd\u8fc7\u6765\u53c8\u51cf\u5c11\u4e86\u4e0b\u8f7d\u65f6\u95f4\u548c\u5e26\u5bbd\u7684\u4f7f\u7528\uff0c\u653e\u5927\u65f6\u4e5f\u6bd4\u8f83\u597d\u770b\uff0c\u53ef\u4ee5\u8ba9\u60a8\u521b\u9020\u51fa\u4e00\u4e2a\u66f4\u7075\u6d3b\u7684\u5e03\u5c40\u3002\u2026\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,198],"tags":[363,177,1271,135,189],"_links":{"self":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/727"}],"collection":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/comments?post=727"}],"version-history":[{"count":0,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/727\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/media?parent=727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/categories?post=727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/tags?post=727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}