{"id":2373,"date":"2017-11-29T15:45:45","date_gmt":"2017-11-29T07:45:45","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=2373"},"modified":"2017-11-29T15:45:45","modified_gmt":"2017-11-29T07:45:45","slug":"css3-radial-gradient%e5%be%84%e5%90%91%e6%b8%90%e5%8f%98%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=2373","title":{"rendered":"CSS3 radial-gradient(\u5f84\u5411\u6e10\u53d8)\u6559\u7a0b"},"content":{"rendered":"<p>\n\t<a href=\"http:\/\/dev.w3.org\/csswg\/css3-images\/\" target=\"_blank\">CSS3 Gradient<\/a>\u5206\u4e3a<a href=\"http:\/\/lists.w3.org\/Archives\/Public\/www-style\/2011Apr\/0083.html\" target=\"_blank\">linear-gradient<\/a>(\u7ebf\u6027\u6e10\u53d8)\u548c<a href=\"http:\/\/lists.w3.org\/Archives\/Public\/www-style\/2011Feb\/0537.html\" target=\"_blank\">radial-gradient<\/a>(\u5f84\u5411\u6e10\u53d8)\u3002\u5b9e\u9645\u5f00\u53d1\u7684\u65f6\u5019\uff0c\u5f53\u8981\u4f7f\u7528radial-gradient\u5f84\u5411\u6e10\u53d8\u7684\u65f6\u5019\uff0c\u8111\u4e2d\u4f1a\u6709\u5927\u6982\u7684\u8bed\u6cd5\uff0c\u4f46\u662f\u7ec6\u8282\u5374\u8bb0\u4e0d\u4f4f\uff0c\u56e0\u6b64\u6211\u8fd9\u91cc\u6574\u7406\u4e00\u7bc7\u76f8\u5173\u6559\u7a0b\uff0c\u5305\u542b\u5b83\u7684\u7528\u6cd5\u548cat\u8bed\u6cd5\u3002\n<\/p>\n<p>\n\t\u6211\u4eec\u5148\u770b\u4e00\u4e2a\u6700\u7b80\u5355\u7684\u4f8b\u5b50\u3002\n<\/p>\n<p>\n\tCSS \u4ee3\u7801\u5982\u4e0b\uff1a\n<\/p>\n<pre class=\"brush:css;\">\r\n.radial-gradient {\r\n    width: 400px; height: 200px;\r\n    background: radial-gradient(yellow, red);\r\n}<\/pre>\n<p>\n\tHTML\u4ee3\u7801\u5982\u4e0b\uff1a\n<\/p>\n<pre class=\"brush:xml;\">\r\n&lt;div class=&quot;radial-gradient&quot;&gt;&lt;\/div&gt;<\/pre>\n<p>\n\t\u6700\u7ec8\u7684\u8fd0\u884c\u6548\u679c\u5982\u4e0b\uff1a\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"radial-gradient\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201711\/2017-11-21_222122.jpg\" style=\"width: 400px;height: 200px\" \/>\n<\/p>\n<p>\n\t\u4e0a\u9762\u662f\u4e00\u4e2a\u6700\u7b80\u5355\u7684\u4f8b\u5b50\uff0c\u5982\u679c\u6211\u4eec\u9700\u8981\u4e00\u4e2a\u5706\u5f62\u7684\u5f84\u5411\u6e10\u53d8\uff0c\u8be5\u600e\u4e48\u505a\u5462\uff1f\u770b\u4e0b\u9762\u7684\u4ee3\u7801\u3002\n<\/p>\n<pre class=\"brush:xml;\">\r\n&lt;style&gt;\r\ndiv {\r\n  width:100px;height:100px;border-radius:50px;\r\n  background:radial-gradient(at 35px 35px,#FFF,#CCC,#FFF);\r\n  background:-webkit-radial-gradient(35px 35px,#FFF,#CCC,#FFF);\r\n}\r\n&lt;\/style&gt;\r\n&lt;div&gt;&lt;\/div&gt;<\/pre>\n<p>\n\t\u6700\u7ec8\u7684\u8fd0\u884c\u6548\u679c\u5982\u4e0b\uff1a\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"radial-gradient\" src=\"http:\/\/www.web-tinker.com\/pictures\/0e3ccd0e1fa4a74f3cc7daae815604d7.png\" style=\"width: 470px;height: 461px\" \/>\n<\/p>\n<p>\n\tFireFox\u548cOpera\u4e0d\u9700\u8981\u524d\u7f00\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528radial-gradient\uff08\u5b83\u4eec\u66fe\u7ecf\u4e5f\u9700\u8981\u524d\u7f00\uff0c\u73b0\u5728\u4e0d\u9700\u8981\u4e86\uff09\u3002Chrome\u9700\u8981-webkit-\u524d\u7f00\u624d\u53ef\u4ee5\u4f7f\u7528\u3002\u800c\u4e14\u6709\u524d\u7f00\u7684\u5f84\u5411\u6e10\u53d8\u548c\u6ca1\u6709\u524d\u7f00\u7684\u5f84\u5411\u6e10\u53d8\u8bed\u6cd5\u6709\u4e00\u70b9\u4e0d\u540c\u3002\n<\/p>\n<h2>\n\tat\u8bed\u6cd5<br \/>\n<\/h2>\n<p>\n\tat\u8bed\u6cd5\u53ef\u4ee5\u7528\u4e0b\u9762\u7684\u516c\u5f0f\u6765\u5957\u7528\u3002\n<\/p>\n<pre class=\"brush:jscript;\">\r\nradial-gradient(\r\n  [\r\n    [\u6e10\u53d8\u5927\u5c0f]?\r\n    [ at \u6e10\u53d8\u5706\u5fc3\u5750\u6807]?\r\n  ,]?\r\n  \u989c\u8272[ \u5f00\u59cb\u4f4d\u7f6e]\r\n  [,\u989c\u8272[ \u5f00\u59cb\u4f4d\u7f6e]]+\r\n);<\/pre>\n<p>\n\t\u5176\u5b9e\u771f\u6b63\u7684\u8bed\u6cd5\u6bd4\u8fd9\u4e2a\u590d\u6742\u5f88\u591a\uff0c\u7b2c\u4e00\u4e2a\u53c2\u6570\u7528\u6765\u6307\u5b9a\u4f4d\u7f6e\u548c\u5927\u5c0f\uff0c\u540e\u9762\u662f\u989c\u8272\u5217\u8868\u3002\u7b2c\u4e00\u4e2a\u53c2\u6570\u7684\u683c\u5f0f\u662f&ldquo;\u6e10\u53d8\u5927\u5c0f at \u6e10\u53d8\u5706\u5fc3\u5750\u6807&rdquo;\u3002\u6e10\u53d8\u5927\u5c0f\u5982\u679c\u53ea\u6709\u4e00\u4e2a\u503c\uff0c\u90a3\u4e48\u5b83\u5c31\u4ee3\u8868\u8fd9\u4e2a\u6e10\u53d8\u662f\u4e2a\u6b63\u5706\uff0c\u8fd9\u4e2a\u6570\u503c\u662f\u5b83\u7684\u534a\u5f84\u3002\u5982\u679c\u662f\u4e24\u4e2a\u503c\uff0c\u628a\u8fd9\u4e2a\u6e10\u53d8\u53d8\u6210\u692d\u5706\u5f62\u7684\uff1b\u6e10\u53d8\u5706\u5fc3\u5750\u6807\u662f\u4ece\u5bb9\u5668\u7684\u539f\u70b9\u5f00\u59cb\u7b97\u8d77\u3002\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"radial-gradient\" src=\"http:\/\/www.web-tinker.com\/pictures\/ebac1150ce944eb75f1bb65840fe9f55.png\" style=\"width: 213px;height: 151px\" \/>\n<\/p>\n<p>\n\t\u8fd9\u4e9b\u53c2\u6570\u662f\u53ef\u4ee5\u4e0d\u6307\u5b9a\u800c\u4f7f\u7528\u9ed8\u8ba4\u503c\u7684\u3002\u5706\u5fc3\u5750\u6807\u7684\u9ed8\u8ba4\u503c\u662f\u5bb9\u5668\u7684\u4e2d\u5fc3\uff0c\u8fd9\u4e2a\u6bd4\u8f83\u7b80\u5355\u3002\u800c\u6e10\u53d8\u5927\u5c0f\u7684\u9ed8\u8ba4\u503c\u5c31\u6bd4\u8f83\u590d\u6742\u4e86\u3002\u5982\u679c\u5bb9\u5668\u662f\u6b63\u65b9\u5f62\u7684\uff0c\u90a3\u4e48\u6e10\u53d8\u5927\u5c0f\u7684\u9ed8\u8ba4\u503c\u5c31\u662f\u4e00\u4e2a\u6b63\u5706\u3002\u8fd9\u4e2a\u6b63\u5706\u7684\u534a\u5f84\u662f\u5706\u5fc3\u5230\u5bb9\u5668\u6700\u8fdc\u89d2\u7684\u8ddd\u79bb\u3002\n<\/p>\n<p>\n\t\u5bf9\u4e8e\u5f84\u5411\u6e10\u53d8\uff0c\u5728\u4e0d\u6307\u5b9a\u6e10\u53d8\u7c7b\u578b\u4ee5\u53ca\u4f4d\u7f6e\u7684\u60c5\u51b5\u4e0b\uff0c\u5176\u6e10\u53d8\u8ddd\u79bb\u548c\u4f4d\u7f6e\u662f\u7531\u5bb9\u5668\u7684\u5c3a\u5bf8\u51b3\u5b9a\u7684\u3002\n<\/p>\n<p>\n\t\u5bb9\u5668\u7684\u5bbd\u9ad8\u6bd4\u662f2:1\uff0c\u6700\u7ec8\u6e10\u53d8\u5448\u73b0\u51fa\u6765\u7684\u5f62\u72b6\u4e5f\u662f\u4e00\u4e2a2:1\u7684\u692d\u5706\u5f62\uff0c\u5e76\u4e14\u6e10\u53d8\u989c\u8272\u81ea\u52a8\u7ec8\u6b62\u4e0e\u5bb9\u5668\u7684\u8fb9\u7f18\u3002\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"radial-gradient\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201711\/radial-gradient-ray.png\" style=\"width: 500px;height: 234px\" \/>\n<\/p>\n<p>\n\t\u5982\u679c\u6211\u4eec\u60f3\u6307\u5b9a\u6e10\u53d8\u7684\u5f62\u72b6\u662f\u4e00\u4e2a\u5706\u5f62\uff0c\u5f62\u72b6\u4e0d\u53d7\u5916\u90e8\u5bb9\u5668\u5c3a\u5bf8\u5f71\u54cd\uff0c\u53ef\u4ee5\u4f7f\u7528circle\u5173\u952e\u5b57\u3002\n<\/p>\n<h2>\n\t\u53c2\u8003\u8d44\u6599<br \/>\n<\/h2>\n<ul>\n<li>\n\t\t<a href=\"https:\/\/drafts.csswg.org\/css-images-3\/\" name=\"CSS Images Module Level 3\" target=\"_blank\" title=\"CSS Images Module Level 3\">CSS Images Module Level 3<\/a>\n\t<\/li>\n<li>\n\t\t<a href=\"http:\/\/lists.w3.org\/Archives\/Public\/www-style\/2011Feb\/0537.html\" name=\"[css3-images] 'contain' radial gradients edge case\" target=\"_blank\" title=\"[css3-images] 'contain' radial gradients edge case\">[css3-images] &#039;contain&#039; radial gradients edge case<\/a>\n\t<\/li>\n<li>\n\t\t<a href=\"http:\/\/lists.w3.org\/Archives\/Public\/www-style\/2011Apr\/0083.html\" name=\"[css3] linear-gradient() proposal\" target=\"_blank\" title=\"[css3] linear-gradient() proposal\">[css3] linear-gradient() proposal<\/a>\n\t<\/li>\n<\/ul>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=2373\">CSS3 radial-gradient(\u5f84\u5411\u6e10\u53d8)\u6559\u7a0b<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>CSS3 Gradient\u5206\u4e3alinear-gradient(\u7ebf\u6027\u6e10\u53d8)\u548cradial-gradient(\u5f84\u5411 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[814,119],"class_list":["post-2373","post","type-post","status-publish","format-standard","hentry","category-html5","tag-css3","tag-html5"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2373","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2373"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2373\/revisions"}],"predecessor-version":[{"id":2374,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2373\/revisions\/2374"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2373"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}