{"id":10308,"date":"2022-02-25T18:09:36","date_gmt":"2022-02-25T10:09:36","guid":{"rendered":"https:\/\/www.zhangxinxu.com\/wordpress\/?p=10308"},"modified":"2022-03-14T17:24:00","modified_gmt":"2022-03-14T09:24:00","slug":"css-border-image-tap-highlight","status":"publish","type":"post","link":"https:\/\/www.zhangxinxu.com\/wordpress\/2022\/02\/css-border-image-tap-highlight\/","title":{"rendered":"\u88ab\u4f4e\u4f30\u7684border-image\u5c5e\u6027"},"content":{"rendered":"<p>by <a href=\"https:\/\/www.zhangxinxu.com\/\">zhangxinxu<\/a> from <a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=10308\">https:\/\/www.zhangxinxu.com\/wordpress\/?p=10308<\/a> \u946b\u7a7a\u95f4-\u946b\u751f\u6d3b<br \/>\n\u672c\u6587\u6b22\u8fce\u5206\u4eab\u4e0e\u805a\u5408\uff0c\u5168\u6587\u8f6c\u8f7d\u5c31\u4e0d\u5fc5\u4e86\uff0c\u5c0a\u91cd\u7248\u6743\uff0c\u5708\u5b50\u5c31\u8fd9\u4e48\u5927\uff0c\u82e5\u6025\u7528\u53ef\u4ee5\u8054\u7cfb\u6388\u6743\u3002<\/p>\n<p><script>window.wxShareImgUrl = 'https:\/\/www.zhangxinxu.com\/study\/image\/share\/202202-border-image.png';<\/script><\/p>\n<p>\u672c\u6587\u4e0d\u8bb2\u5177\u4f53\u7684 <code>border-image<\/code> \u8bed\u6cd5\uff0c\u56e0\u4e3a\u8bed\u6cd5\u5e9e\u6742\uff0c\u4e0d\u662f\u6211\u9488\u5bf9\u8c01\uff0c\u662f\u5728\u5ea7\u7684\u6240\u6709\u4e2a\u4f4d\u90fd\u6d88\u5316\u4e0d\u4e86\uff0c\u6240\u4ee5\uff0c\u76f4\u6307\u8981\u5bb3\uff0c\u8bb2\u8bb2\u90a3\u4e9b\u53ea\u6709 <code>border-image<\/code> \u80fd\u591f\u5b9e\u73b0\u7684\u4e8b\u60c5\uff0c\u8bfb\u5b8c\u540e\u53d1\u73b0 <code>border-image<\/code> \u5c5e\u6027\u8fd8\u662f\u633a\u6709\u4e00\u5957\u7684\uff0c\u5219\u53ef\u4ee5\u4e70\u672c <strong>CSS\u65b0\u4e16\u754c<\/strong>\uff0c\u91cc\u9762\u6709\u5bf9 <code>border-image<\/code> \u8bed\u6cd5\u975e\u5e38\u7ec6\u81f4\u7684\u4ecb\u7ecd\u3002<\/p>\n<h3>\u4e00\u3001\u4ece\u9e21\u808b\u534e\u4e3d\u8f6c\u8eab\u7684\u8f6c\u6298\u70b9<\/h3>\n<p>\u5728\u5f88\u957f\u4e00\u6bb5\u65f6\u95f4\u5185\uff0c<code>border-image<\/code> \u5c5e\u6027\u5c31\u662f\u4e2a\u9e21\u808b\u5c5e\u6027\uff0c\u6709\u7740\u975e\u5e38\u602a\u5f02\u7684\u6e32\u67d3\u673a\u5236\uff0c\u9700\u8981\u628a\u56fe\u5207\u6210 9 \u5757\uff0c\u5206\u522b\u586b\u5145\u5230\u8fb9\u6846\u7684 9 \u4e2a\u533a\u57df\u3002<\/p>\n<p>\u51e0\u4e4e\u6240\u6709\u7684 CSS \u6837\u5f0f\u6e32\u67d3\u5c5e\u6027\uff0c\u65e0\u8bba\u662f\u6e10\u53d8\u3001\u5706\u89d2\u3001\u76d2\u9634\u5f71\u3001\u6ee4\u955c\u8fd8\u662f\u6df7\u5408\u6a21\u5f0f\uff0c\u90fd\u53ef\u4ee5\u4ece\u8bbe\u8ba1\u8f6f\u4ef6\u4e2d\u627e\u5230\u5bf9\u5e94\u7684\u8bbe\u7f6e\u9009\u9879\uff0c\u552f\u4e00\u4e00\u4e2a\u4f8b\u5916\u5c31\u662f <code>border-image<\/code>\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48\u4f1a\u51fa\u73b0\u8fd9\u79cd\u73b0\u8c61\u5462\uff1f<\/p>\n<p>\u73b0\u5728\u7684\u5c0f\u5e74\u8f7b\u80af\u5b9a\u4e0d\u77e5\u9053\u80cc\u540e\u7684\u539f\u56e0\uff0c\u5bb9\u6211\u6765\u7ed9\u5927\u5bb6\u8bb2\u8bb2\u3002<\/p>\n<p>\u5728 CSS3 \u8fd8\u6ca1\u6709\u51fa\u73b0\u7684\u5e74\u4ee3\uff0c\u90a3\u4e2a\u65f6\u5019\uff0c\u6240\u6709\u7684\u5f69\u8272\u6548\u679c\u3001\u6240\u6709\u7684\u5706\u89d2\u6548\u679c\u4e00\u5b9a\u662fPNG\u5c0f\u56fe\u7247\u5b9e\u73b0\u7684\uff0c\u4f8b\u5982\uff0c\u4e00\u4e9b\u6e10\u53d8\u6309\u94ae\uff0c\u8fd8\u6709\u4e00\u4e9b\u6e10\u53d8\u9009\u9879\u5361\u3002<\/p>\n<p>\u5f53\u65f6\uff0c\u4e3a\u4e86\u8ba9\u8fd9\u4e9b\u56fe\u50cf\u53ef\u4ee5\u9002\u5e94\u8db3\u591f\u591a\u7684\u6587\u5b57\uff0c\u4f1a\u901a\u8fc7\u7279\u6b8a\u7684\u5207\u56fe\uff0c\u901a\u8fc7\u4e24\u5c42 HTML \u6807\u7b7e\u5d4c\u5957\uff0c\u914d\u5408 <code>background-position<\/code> \u5c5e\u6027\u5b9e\u73b0\u3002<\/p>\n<p>\u6bd4\u65b9\u8bf4\u4e0b\u56fe\u5c31\u662f\u5f53\u5e74\u5b9e\u73b01-7\u4e2a\u5b57\u7b26\u5bbd\u5ea6\u81ea\u9002\u5e94\u9009\u9879\u5361\u4f7f\u7528\u7684 PNG \u5c0f\u56fe\u7247\uff0c\u4e2d\u95f4\u6709\u4e00\u6bb5\u9542\u7a7a\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202202\/old-tab.png\" width=\"167\" height=\"27\" alt=\"\u81ea\u9002\u5e94\u9009\u9879\u5361 PNG \u56fe\"><\/p>\n<p>HTML \u7ed3\u6784\u662f\u8fd9\u6837\u7684\uff1a<\/p>\n<pre>&lt;a href class=\"outer\"&gt;\r\n    &lt;span class=\"inner\"&gt;\u9009\u9879\u5361&lt;\/span&gt;\r\n&lt;\/a&gt;<\/pre>\n<p>\u8fd9\u4e2a\u5c31\u662f\u6700\u7ec8\u5b9e\u73b0\u7684\u6548\u679c\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202202\/tab-affect.png\" width=\"90\" height=\"30\" alt=\"\u5b9e\u73b0\u7684\u9009\u9879\u5361\u6548\u679c\"><\/p>\n<p>\u662f\u4e0d\u662f\u5f88\u9ebb\u70e6\uff1f\u65e0\u8bba\u662f\u5207\u56fe\u8fd8\u662f\u5199\u4ee3\u7801\uff1f<\/p>\n<p>\u4e8e\u662f\u5c31\u50ac\u751f\u4e86 <code>border-image<\/code> \u5c5e\u6027\uff0c\u4e13\u95e8\u7528\u6765\u5b9e\u73b0 PNG \u5c0f\u56fe\u7247\u7684\u5185\u5bb9\u81ea\u9002\u5e94\u6548\u679c\uff0c\u53ea\u9700\u8981\u63d0\u4f9b\u4e00\u4e2a\u89c4\u6574\u7684\uff08\u8fd8\u662f\u9700\u8981\u5904\u7406\uff09\u7684\u4f53\u79ef\u66f4\u5c0f\u7684\u56fe\u7247\uff0c\u5c31\u53ef\u4ee5\u5b9e\u73b0\u4efb\u610f\u5b57\u6570\u7684\u6837\u5f0f\u6548\u679c\u4e86\u3002<\/p>\n<p>\u4e0b\u9762\u5c31\u662f\u4e00\u4e9b\u5178\u578b\u7684\u6848\u4f8b\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202202\/border-image-example.png\" width=\"306\" height=\"204\" alt=\"border-image\u5178\u578b\u5e94\u7528\"><\/p>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a href=\"https:\/\/demo.cssworld.cn\/new\/3\/3-6.php\" target=\"_cssworld\" class=\"a_link\">border-image \u8bbe\u8ba1\u521d\u8877\u4f5c\u7528demo<\/a><\/p>\n<p>\u770b\u8d77\u6765 <code>border-image<\/code> \u5c5e\u6027\u8fd8\u6709\u70b9\u7528\uff0c\u4f46\u662f\u5927\u5bb6\u4ed4\u7ec6\u89c2\u5bdf\u4e0a\u9762\u7684\u6548\u679c\u56fe\uff0c\u5f88\u5bb9\u6613\u5c31\u4f1a\u53d1\u73b0\uff0c\u8fd9\u4e9b\u6240\u8c13\u7684\u81ea\u9002\u5e94\u6548\u679c\uff0c\u5706\u89d2\u6548\u679c\uff0c\u7279\u4e48\u76f4\u63a5 Gradient \u6e10\u53d8\u3001<code>box-shadow<\/code> \u76d2\u9634\u5f71\u4ee5\u53ca <code>border-radius<\/code> \u5706\u89d2\u5c31\u53ef\u4ee5\u5b9e\u73b0\uff0c\u4ee3\u7801\u7b80\u5355\u6613\u4e0a\u624b\uff0c\u5173\u952e\u662f\u517c\u5bb9\u6027\u7edd\u8d5e\uff08IE10+\u652f\u6301\uff09\uff0c\u6bd4 <code>border-image<\/code> \u5c5e\u6027\u7684\u517c\u5bb9\u6027\uff08IE11+\uff09\u8fd8\u8981\u597d\uff0c\u8d44\u6e90\u5f00\u9500\u4e5f\u5c0f\uff0c\u8fd9\u5c31\u5bfc\u81f4\u6ca1\u6709\u4efb\u4f55\u9700\u8981\u4f7f\u7528 <code>border-image<\/code> \u7684\u7406\u7531\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202202\/border-image-s.png\" width=\"320\" height=\"192\" alt=\"border-image \u6548\u679c\u88ab\u5176\u4ed6\u5c5e\u6027\u4ee3\u66ff\" class=\"alignnone size-medium\" \/><\/p>\n<p><code>border-image<\/code> \u5c5e\u6027\u4ece\u6b64\u6ca6\u4e3a\u4e86\u9e21\u808b\uff0c\u53ea\u5728\u67d0\u4e9b\u82b1\u91cc\u82b1\u54e8\u7684\u8fb9\u6846\u88c5\u9970\u573a\u666f\u8fd8\u6709\u4e00\u70b9\u4f7f\u7528\u4ef7\u503c\uff08\u56e0\u4e3a\u4e0d\u5f97\u4e0d\u4f7f\u7528\u56fe\u7247\uff09\u3002<\/p>\n<p>\u7136\u800c\uff0c\u6545\u4e8b\u5728\u8fd9\u91cc\u5e76\u6ca1\u6709\u7ed3\u675f\uff0c\u968f\u7740\u65f6\u95f4\u7684\u6d41\u901d\uff0c\u4ece 2012 \u5e74\u5f00\u59cb\uff0c\u5728\u63a5\u4e0b\u67651-2\u5e74\u7684\u65f6\u95f4\u5185\uff0c\u968f\u7740\u67d0\u4e00\u4e9b\u65b0\u7279\u6027\u7684\u652f\u6301\uff0c<code>border-image<\/code> \u5c5e\u6027\u8fce\u6765\u4e86\u65b0\u751f\uff0c\u5f00\u59cb\u5728\u7279\u5b9a\u7684\u573a\u666f\u4e0b\u7efd\u653e\u51fa\u522b\u6837\u7684\u7ade\u4e89\u529b\u3002<\/p>\n<p>\u8fd9\u4e2a\u7279\u6027\u5c31\u662f\uff1a<\/p>\n<ul>\n<li>2012\u5e747\u6708 Firefox \u548c Safari \u7d27\u968f Chrome \u6d4f\u89c8\u5668\u7684\u6b65\u4f10\u5bf9 <code>border-image<\/code> \u65b0\u8bed\u6cd5\u652f\u6301\uff0c\u5305\u62ec\uff1a<code>border-image:fill<\/code> \u548c <code>border-image-outset<\/code> \u5c5e\u6027\uff1b<\/li>\n<li>2014\u5e744\u6708\uff0cFirefox \u6d4f\u89c8\u5668\u7ec8\u4e8e\u652f\u6301\u4e86 <code>border-image<\/code> \u7684\u6e10\u53d8\u56fe\u50cf\u529f\u80fd\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u4e24\u4e2a\u65b0\u53d8\u5316\u8ba9 <code>border-image<\/code> \u5c5e\u6027\u8fce\u6765\u4e86\u65b0\u751f\uff0c\u6210\u4e3a\u4e86\u4e00\u4e2a\u88ab\u8fdc\u8fdc\u4f4e\u4f30\u7684 CSS \u5c5e\u6027\u3002<\/p>\n<h3>\u4e8c\u3001\u4ece\u7b80\u5355\u7684\u6e10\u53d8\u8fb9\u6846\u8bf4\u8d77<\/h3>\n<p>\u7531\u4e8e <code>border-image<\/code> \u652f\u6301\u4e86\u6e10\u53d8\u56fe\u50cf\uff0c\u56e0\u6b64\u53ef\u4ee5\u8f7b\u677e\u5b9e\u73b0\u5176\u4ed6 CSS \u5c5e\u6027\u4e0d\u592a\u597d\u5b9e\u73b0\u7684\u6e10\u53d8\u8fb9\u6846\u6548\u679c\u3002<\/p>\n<pre>&lt;p class=\"border-linear-gradient\"&gt;\u4e0a\u4e0b\u6e10\u53d8\u8fb9\u6846&lt;\/p&gt;\r\n&lt;p class=\"border-radial-gradient\"&gt;\u5f84\u5411\u6e10\u53d8\u8fb9\u6846&lt;\/p&gt;\r\n<\/pre>\n<pre>.border-linear-gradient {\r\n    border-style: solid;\r\n    border-image: linear-gradient(deepskyblue, deeppink) 20 \/ 10px;\r\n}\r\n.border-radial-gradient {\r\n    border-style: solid;\r\n    border-image: radial-gradient(deepskyblue, deeppink) 20 \/ 10px;\r\n}<\/pre>\n<p>\u6548\u679c\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202202\/gradient-border.png\" width=\"300\" height=\"176\" alt=\"\u6e10\u53d8\u8fb9\u6846\"><\/p>\n<p>\u8981\u60f3\u8b66\u793a\u67d0\u4e00\u6bb5\u5185\u5bb9\u5b58\u5728\u98ce\u9669\uff0c\u53ef\u4ee5\u4f7f\u7528\u7ea2\u8272\u7684\u6761\u7eb9\u8fb9\u6846\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre>&lt;div class=\"border-stripe\"&gt;\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u7ea2\u8272\u6761\u7eb9\u8fb9\u6846\u8868\u793a\u8b66\u793a&lt;\/div&gt;<\/pre>\n<pre>.border-stripe {\r\n    border: 12px solid;\r\n    border-image: repeating-linear-gradient(-45deg, red, red 5px, transparent 5px, transparent 10px) 12;\r\n}<\/pre>\n<p>MDN \u4e00\u4e9b\u5e9f\u5f03\u6587\u6863\u7684\u8b66\u793a\u8fb9\u6846\u5c31\u662f\u4f7f\u7528 <code>border-image<\/code> \u5c5e\u6027\u5b9e\u73b0\u4e86\uff0c\u6548\u679c\u622a\u56fe\u53c2\u89c1\u4e0b\u65b9\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202202\/pattern-border.png\" width=\"300\" height=\"64\" alt=\"\u7ea2\u8272\u659c\u7eb9\u8b66\u793a\u8fb9\u6846\"><\/p>\n<p>\u6211\u4eec\u751a\u81f3\u53ef\u4ee5\u7528 <code>border-image<\/code> \u5c5e\u6027\u91cd\u65b0\u5b9a\u4e49\u5143\u7d20\u7684\u865a\u7ebf\u8fb9\u6846\uff0c\u865a\u7ebf\u7684\u5c3a\u5bf8\u548c\u865a\u5b9e\u6bd4\u4f8b\u90fd\u53ef\u4ee5\u968f\u610f\u63a7\u5236\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre>&lt;div class=\"border-dashed\"&gt;1:1\u7684\u865a\u7ebf&lt;\/div&gt;<\/pre>\n<pre>.border-dashed {\r\n    border: 1px dashed deepskyblue;\r\n    border-image: repeating-linear-gradient(135deg, deepskyblue, deepskyblue 5px, transparent 5px, transparent 10px) 1;\r\n}<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202202\/dashed-border.png\" width=\"563\" height=\"118\" alt=\"\u517c\u5bb9\u6027\u4e00\u81f4\u7684\u865a\u7ebf\u8fb9\u6846\"><\/p>\n<h3>\u4e09\u3001\u53cd\u9988\u6001\u4e2d\u7684\u5e94\u7528<\/h3>\n<p>\u79fb\u52a8\u7aef\u5f00\u53d1\u8005\uff0c\u53ef\u4ea4\u4e92\u5143\u7d20\u9700\u8981\u6709\u70b9\u51fb\u53cd\u9988\u6001\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202202\/2022-02-23_110059.png\" width=\"425\" height=\"151\" alt=\"\u53cd\u9988\u6001\u6548\u679c\u793a\u610f\"><\/p>\n<p>\u901a\u5e38\u505a\u6cd5\u662f\uff1a<\/p>\n<pre>a[href]:active, button:active {\r\n    background-image: linear-gradient(rgba(0,0,0,.05), rgba(0,0,0,.05));\r\n}<\/pre>\n<p>\u5982\u679c\u5143\u7d20\u672c\u8eab\u6709 <code>background-image<\/code> \u56fe\u5f62\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528 <code>box-shadow<\/code> \u5c5e\u6027\u6a21\u62df\uff1a<\/p>\n<pre>button:active {\r\n    box-shadow: inset 0 0 0 999px rgba(0,0,0,.05);\r\n}<\/pre>\n<p>\u5982\u679c\u76d2\u9634\u5f71\u4e5f\u88ab\u5360\u7528\uff0c\u5219\u8fd8\u6709\u4e00\u62db\uff0c\u90a3\u5c31\u662f <code>border-image<\/code>\uff1a<\/p>\n<pre>button:active {\r\n    border-image: linear-gradient(rgba(0,0,0,.05), rgba(0,0,0,.05)) 1 fill;\r\n}<\/pre>\n<p>\u7279\u522b\u9002\u5408\u65e0\u8fb9\u6846\u7684\u573a\u666f\uff0c\u6548\u679c\u793a\u610f\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202202\/button-active.gif\" width=\"252\" height=\"65\" alt=\"border-image\u6309\u94ae\u70b9\u51fb\u53cd\u9988\"><\/p>\n<p>\u5982\u679c\u5230\u8fd9\u91cc\u5c31\u7ed3\u675f\uff0c\u90a3\u5c31\u592a\u5c0f\u513f\u79d1\u4e86\uff0c<code>border-image<\/code> \u8fd8\u6709\u4e2a\u5389\u5bb3\u7684\u5b50\u5c5e\u6027 <code>border-image-outset<\/code>\uff0c\u53ef\u4ee5\u6269\u5c55\u8fb9\u6846\u56fe\u50cf\u7684\u8303\u56f4\uff0c\u8fd9\u4e2a\u53ef\u662f\u4e2a\u5927\u6740\u5668\u3002<\/p>\n<p>\u5148\u4ece\u6211\u6700\u8fd1\u9047\u5230\u7684\u4e00\u4e2a\u5b9e\u9645\u4ea4\u4e92\u573a\u666f\u8bf4\u8d77\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202202\/input-active.gif\" width=\"333\" height=\"173\" alt=\"\u5b50\u9879active\u7a7f\u900f\"><\/p>\n<p>\u63cf\u8ff0\u4e3a\u70b9\u51fb\u8f93\u5165\u6846\uff0c\u6574\u4e2a\u5217\u8868\u9879\u51fa\u73b0\u53cd\u9988\u6001\uff0c\u5982\u679c\u662f\u70b9\u51fb\u5176\u4ed6\u4f4d\u7f6e\uff0c\u5219\u6ca1\u6709\u4efb\u4f55\u53cd\u9988\u3002<\/p>\n<p>\u5982\u679c\u662f\u4f60\uff0c\u4f60\u4f1a\u600e\u4e48\u5b9e\u73b0\uff1f<\/p>\n<p>\u6709\u4e00\u79cd\u505a\u6cd5\u662f\u8fd9\u6837\u7684\uff1a<\/p>\n<pre>.list:focus-within:active {\r\n    background-image: linear-gradient(rgba(0,0,0,.05), rgba(0,0,0,.05));\r\n}<\/pre>\n<p>\u4f46\u662f\uff0c\u5982\u679c\u5217\u8868\u4e2d\u540c\u65f6\u6709\u6309\u94ae\uff0c\u5c31\u4f1a\u6709\u95ee\u9898\uff0c\u56e0\u4e3a\u70b9\u51fb\u6309\u94ae\u7684\u65f6\u5019\uff0c\u4e5f\u4f1a\u89e6\u53d1\u6b64\u9009\u62e9\u5668\u7684\u6267\u884c\uff0c\u8fd9\u5e76\u4e0d\u662f\u6211\u4eec\u5e0c\u671b\u7684\u6548\u679c\uff0c\u8fd9\u4e2a\u65f6\u5019\uff0c\u5c31\u8f6e\u5230 <code>border-image<\/code> \u5c5e\u6027\u51fa\u9a6c\u7684\u65f6\u5019\u4e86\u3002<\/p>\n<pre>list {\r\n    overflow: clip;    \r\n}\r\ninput:active {\r\n    border-image: linear-gradient(rgba(0,0,0,.05), rgba(0,0,0,.05)) 1 fill \/ \/ 100vw;\r\n}<\/pre>\n<p>\u5bf9\u5185 fill \u586b\u5145\uff0c\u5bf9\u5916 outset \u6269\u5c55\uff0c\u586b\u6ee1\u6574\u4e2a\u533a\u57df\u3002<\/p>\n<h4>\u5bf9\u6bd4\u5176\u4ed6\u5b9e\u73b0<\/h4>\n<ul>\n<li><code>background-image<\/code> \u65e0\u6cd5\u6269\u5c55\uff1b<\/li>\n<li><code>outline<\/code> \u5219\u662f\u5c42\u7ea7\u4e0d\u5bf9\uff0c\u4f1a\u8986\u76d6\u8f93\u5165\u6846\u7684\u6587\u5b57\u5185\u5bb9\u3002\n<pre>input:active {\r\n    outline: 199vw solid rgba(0,0,0,.05);\r\n    outline-offset: -999px;\r\n}<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202202\/outline-vs-border-image.gif\" width=\"331\" height=\"358\" alt=\"outline\u8986\u76d6\u8f93\u5165\u6846\u6587\u5b57\u793a\u610f\">\n<\/li>\n<li><code>box-shadow<\/code> \u5c42\u7ea7\u5728\u6587\u5b57\u4e4b\u4e0b\uff0c\u4e0d\u8fc7\u9700\u8981\u8981\u6c42\u5143\u7d20\u4e0d\u80fd\u6709\u8fb9\u6846\u5bbd\u5ea6\uff0c\u5426\u5219\u5c31\u4f1a\u6709\u90e8\u5206\u533a\u57df\u7684\u989c\u8272\u9542\u7a7a\uff1a\n<pre>input:active {\r\n    box-shadow: 0 0 0 199vw rgba(0,0,0,.05), inset 0 0 0 999px rgba(0,0,0,.05);\r\n}<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202202\/2022-02-23_151224.png\" width=\"330\" height=\"181\" alt=\"box-shadow\u8fb9\u6846\u95ee\u9898\">\n<\/li>\n<\/ul>\n<p>\u4e8e\u662f\uff0c\u7efc\u5408\u6765\u770b\uff0c\u5728\u8fd9\u4e2a\u573a\u666f\u4e2d\uff0c<code>border-image<\/code> \u5c5e\u6027\u5c5e\u4e8e\u6700\u4f73\u5b9e\u73b0\u3002<\/p>\n<h3>\u56db\u3001\u7edd\u6740\uff1a\u5728\u5143\u7d20\u4e4b\u5916\u6784\u5efa\u56fe\u50cf<\/h3>\n<p>\u5728\u5143\u7d20\u4e4b\u5916\u6784\u5efa\u7eaf\u8272\u6709 <code>outline<\/code> \u548c <code>box-shadow<\/code> \u8fd9\u4e24\u4e2a\u5bf9\u624b\uff0c\u90a3\u5982\u679c\u6709\u9700\u6c42\uff0c\u5e0c\u671b\u5728\u5143\u7d20\u4e4b\u5916\u6784\u5efa\u56fe\u50cf\uff08\u751a\u81f3\u662f\u5143\u7d20\u663e\u793a\uff09\uff0c\u90a3\u4e48 <code>border-image<\/code> \u5c5e\u6027\u5c31\u662f\u4e2a\u738b\u70b8\u3002<\/p>\n<p>\u4f8b\u5982\uff0c\u5e0c\u671b\u5728 <code>&lt;progress&gt;<\/code> \u8fdb\u5ea6\u6761\u4e0a\u65b9\u540c\u65f6\u663e\u793a\u8fdb\u5ea6\u6570\u503c\uff0c\u5728\u4e0d\u5f71\u54cd\u5e03\u5c40\uff0c\u4e0d\u989d\u5916\u521b\u5efa\u5143\u7d20\uff0c\u517c\u5bb9\u6240\u6709\u73b0\u4ee3\u6d4f\u89c8\u5668\u7684\u65b9\u6cd5\u4e00\u5b9a\u53ea\u6709 <code>border-image<\/code> \u5c5e\u6027\u3002<\/p>\n<pre>&lt;progress value=\".5\"&gt;&lt;\/progress&gt;<\/pre>\n<pre>progress {\r\n    width: 300px; height: 6px;\r\n    --img: url(\"data:image\/svg+xml,%3Csvg width='300' height='30' xmlns='http:\/\/www.w3.org\/2000\/svg'%3E%3Ctext x='50%25' y='50%25' font-size='14' fill='%232a80eb' font-family='system-ui, sans-serif' text-anchor='middle' dominant-baseline='middle'%3E50%%3C\/text%3E%3C\/svg%3E\");\r\n    border-image: var(--img) 0 fill \/ \/ 26px 0 0;\r\n}<\/pre>\n<p>\u6548\u679c\u5982\u4e0b\u622a\u56fe\u6240\u793a\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202202\/2022-02-23_160739.png\" width=\"472\" height=\"352\" alt=\"\u5143\u7d20\u5916\u663e\u793a\u6570\u5b57\"><\/p>\n<p>\u7acb\u8db3\u4e8e\u5b9e\u9645\u5f00\u53d1\uff0c\u8fd9\u79cd\u6784\u5efa\u9700\u8981\u548c JS \u914d\u5408\uff0c\u8d70\u7ec4\u4ef6\u6a21\u5f0f\uff0c\u56fe\u50cf\u8ddf\u968f\u5143\u7d20\u5b9e\u65f6\u52a8\u6001\u751f\u6210\uff0c\u56e0\u4e3a <code>border-image<\/code> \u5728\u5143\u7d20\u7684\u4efb\u610f\u4f4d\u7f6e\uff08\u5305\u62ec\u5143\u7d20\u5916\uff09\u663e\u793a\u56fe\u50cf\u662f\u6709\u4e00\u4e9b\u5c40\u9650\u7684\u3002<\/p>\n<h4>\u5c40\u9650<\/h4>\n<p>\u6709\u5982\u4e0b\u5c40\u9650\uff1a<\/p>\n<ul>\n<li>\u53ea\u80fd\u4e00\u4e2a\u56fe\u50cf\uff0c\u6781\u9650\u662f\u4e24\u4e2a\u56fe\u50cf\uff0c\u4f7f\u7528 <code>cross-fade()<\/code> \u56fe\u50cf\u51fd\u6570\uff1b<\/li>\n<li>\u586b\u5145\u6a21\u5f0f\u53ea\u80fd\u662f\u62c9\u4f38\uff0c\u4e5f\u5c31\u662f <code>border-image<\/code> \u56fe\u50cf\u4e00\u5b9a\u662f\u62c9\u4f38\u586b\u5145\u5143\u7d20\u533a\u57df\uff0c\u8fd9\u4f7f\u5f97\u56fe\u50cf\u5c3a\u5bf8\u548c\u5143\u7d20\u5c3a\u5bf8\u9700\u8981\u6709\u5339\u914d\u7684\u5bf9\u5e94\u5173\u7cfb\uff0c\u5426\u5219\u56fe\u50cf\u65e0\u6cd5\u4fdd\u6301\u539f\u59cb\u6bd4\u4f8b\u3002\n<p>    \u901a\u5e38\u505a\u6cd5\u662f\u901a\u8fc7 <code>border-image-width<\/code> \u5c5e\u6027\u7ea6\u675f\u6700\u4e2d\u5fc3\u586b\u5145\u533a\u57df\u7684\u5927\u5c0f\uff0c\u4f7f\u586b\u5145\u56fe\u50cf\u4fdd\u6301\u539f\u59cb\u6bd4\u4f8b\uff08\u89c1\u6700\u540e\u90a3\u4e2a\u90ae\u7bb1\u8f93\u5165\u6846\u9a8c\u8bc1\u7684\u6848\u4f8b\uff09\u3002<\/li>\n<li>\u7531\u4e8e\u5c42\u7ea7\u9650\u5236\uff0c\u65e0\u6cd5\u5728\u5143\u7d20\u4e0a\u65b9\u663e\u793a\uff0c\u4f1a\u88ab\u5185\u5bb9\u8986\u76d6\u3002<\/li>\n<li>\u4f1a\u5f71\u54cd\u539f\u672c\u8fb9\u6846\u7684\u663e\u793a\uff0c\u5982\u679c\u540c\u65f6\u9700\u8981\u6709\u8fb9\u6846\u6548\u679c\uff0c\u9700\u8981\u4f7f\u7528 <code>box-shadow<\/code> \u6a21\u62df\u8fb9\u6846\u3002<\/li>\n<\/ul>\n<h4>\u603b\u7ed3<\/h4>\n<p>\u7531\u4e8e\u5143\u7d20\u663e\u793a\u533a\u57df\u5916\u7684\u56fe\u50cf\u663e\u793a\u53ef\u4ee5\u901a\u8fc7\u4f2a\u5143\u7d20\u7edd\u5bf9\u5b9a\u4f4d\u5b9e\u73b0\uff0c\u56e0\u6b64\uff0c<code>border-image<\/code> \u5904\u7406\u533a\u57df\u5916\u56fe\u50cf\u5c31\u9002\u5408\u7528\u5728\u4e0d\u652f\u6301\u4f2a\u5143\u7d20\u7684 HTML \u5143\u7d20\u4e0a\uff0c\u4f8b\u5982\uff1a<code>&lt;input&gt;<\/code>\u3001<code>&lt;textarea&gt;<\/code>\u3001<code>&lt;img&gt;<\/code>\u3001<code>&lt;canvas&gt;<\/code>\u3001<code>&lt;progress&gt;<\/code>\u3001<code>&lt;video&gt;<\/code> \u7b49\u5143\u7d20\u3002<\/p>\n<p>\u4ee5\u53ca\u53ef\u4ee5\u4f7f\u7528\u4f2a\u5143\u7d20\uff0c\u4f46\u662f\u4e0d\u65b9\u4fbf\u4f7f\u7528\u7edd\u5bf9\u5b9a\u4f4d\u3001\u6216\u8005\u5bb9\u5668\u8bbe\u7f6e\u4e86 <code>overflow:hidden<\/code> \u7684\u573a\u666f\uff0c\u8981\u77e5\u9053\uff0c<code>border-image<\/code> \u56fe\u50cf\u6548\u679c\u4e0d\u4f1a\u56e0\u4e3a\u5143\u7d20\u8bbe\u7f6e\u4e86 <code>overflow:hidden<\/code> \u800c\u4e0d\u53ef\u89c1\uff0c\u540c\u65f6\u4e0d\u4f1a\u5360\u636e\u989d\u5916\u7684\u5c3a\u5bf8\uff0c\u4e5f\u5c31\u662f\u65e0\u8bba\u5982\u4f55\u663e\u793a\uff0c\u90fd\u4e0d\u4f1a\u5f71\u54cd\u5e03\u5c40\u3002<\/p>\n<h4>\u518d\u6f14\u793a\u4e2a\u6548\u679c<\/h4>\n<p>\u8fd9\u91cc\u518d\u6f14\u793a\u4e00\u4e2a\u9a8c\u8bc1\u6548\u679c\u5b9e\u73b0\uff0c\u5148\u770b\u4e0b\u6548\u679c\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202202\/input-valid-border-image.gif\" width=\"413\" height=\"54\" alt=\"\u8fb9\u6846\u56fe\u50cf\u6a21\u62df\u7684\u9a8c\u8bc1\"><\/p>\n<p>\u6b64\u6548\u679c\u7eaf CSS \u5b9e\u73b0\uff0c\u5355 <code>&lt;input&gt;<\/code> \u6807\u7b7e\u5b9e\u73b0\uff1a<\/p>\n<pre>\u90ae\u7bb1\uff1a&lt;input type=\"email\" class=\"use-border\" placeholder=\"\u8f93\u5165\u90ae\u7bb1\u89c2\u5bdf\u53d8\u5316\" required&gt;<\/pre>\n<pre>[type=\"email\"] {\r\n    width: 240px; padding: 10px;\r\n    font-size: 100%;\r\n    border: 1px solid transparent;\r\n    background: #fff;\r\n    box-shadow: inset 0 0 0 1px #ccc;\r\n    outline: none;\r\n    --valid: url(\"data:image\/svg+xml,%3Csvg...'\/%3E%3C\/svg%3E\");\r\n    --invalid: url(\"data:image\/svg+xml,%3Csvg...%3E%3C\/svg%3E\");\r\n}\r\n[type=\"email\"]:focus {\r\n    box-shadow: inset 0 0 0 1px #2a80eb;\r\n}\r\n.use-border {\r\n    \/* 20px \u56fe\u6807\u5c3a\u5bf8\uff0c272 \u662f\u8f93\u5165\u6846\u957f\u5ea6 262 + 10px \u504f\u79fb *\/\r\n    border-image: 0 fill \/ 9 0 9 272 \/ 0 30px 0 0;\r\n}\r\n.use-border:valid {\r\n    border-image-source: var(--valid);\r\n}\r\n.use-border:invalid:not(:placeholder-shown) {\r\n    border-image-source: var(--invalid);\r\n}<\/pre>\n<p>\u6700\u5173\u952e\u7684\u5b9e\u73b0\u5c31\u662f\u8fd9\u4e48\u4e00\u53e5\uff1a<\/p>\n<pre>border-image: 0 fill \/ 9 0 9 272 \/ 0 30px 0 0;<\/pre>\n<p>\u5176\u4e2d\uff1a<\/p>\n<ul>\n<li>0 fill \u8868\u793a\u4e0d\u526a\u88c1\uff0c\u76f4\u63a5\u586b\u5145\u5230\u8fb9\u6846\u4e5d\u5bab\u683c\u7684\u4e2d\u5fc3\u4f4d\u7f6e\uff1b<\/li>\n<li>9 0 9 272 \u8868\u793a <code>border-image-width<\/code>\uff0c\u7528\u6765\u786e\u5b9a\u4e00\u4e2a 20 * 20 \u5927\u5c0f\u7684\u4e2d\u5fc3\u533a\u57df\uff0c\u56e0\u4e3a\u8f93\u5165\u6846\u9ad8\u5ea6 38px\uff0c\u5bbd\u5ea6262px\uff0c\u56fe\u6807\u504f\u79fb\u5728\u53f3\u4fa7 30px \u7684\u5730\u65b9\uff0c\u56e0\u6b64\uff0c\u624d\u6709\u53f3\u8fb9\u6846\u5927\u5c0f\u662f 0\uff0c\u5de6\u8fb9\u6846\u5927\u5c0f\u662f 272\uff08262 &#8211; 20 + 30\uff09;<\/li>\n<li>0 30px 0 0 \u8868\u793a <code>border-image-outset<\/code> \u6269\u5c55\u5927\u5c0f\uff0c\u8fd9\u91cc\u53ea\u5f80\u53f3\u6269\u5c55\u4e86 30px \u5927\u5c0f\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u91cc\u4f8b\u5b50\u6709\u9875\u9762\u6f14\u793a\uff0c\u773c\u89c1\u4e3a\u5b9e\uff0c\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a href=\"https:\/\/www.zhangxinxu.com\/study\/202202\/css-input-border-image-valid-demo.php\" target=\"_blank\" class=\"a_link\">CSS border-image \u5b9e\u73b0\u8f93\u5165\u6846\u9a8c\u8bc1\u63d0\u793ademo<\/a><\/p>\n<p>\u591a\u5634\u4e00\u53e5\uff0c\u5982\u679c\u56fe\u50cf\u662f\u8981\u5916\u6302\u5728\u5143\u7d20\u7684\u56db\u4e2a\u8fb9\u89d2\uff0c\u5219\u7406\u89e3\u4e0a\u8981\u76f8\u5bf9\u7b80\u5355\u4e9b\uff0c\u6b64\u65f6\uff0c\u901a\u8fc7\u5229\u7528\u4e5d\u5bab\u683c 4 \u4e2a\u8fb9\u89d2\u5b9e\u73b0\u5373\u53ef\uff0c\u96be\u70b9\u5728\u4e8e\u4e00\u5f00\u59cb\u7684 <code>border-image-slice<\/code>\uff0c\u5047\u8bbe\u56fe\u50cf\u7684\u539f\u59cb\u5c3a\u5bf8\u662f 200px * 200px\uff0c\u9700\u8981\u5b9a\u4f4d\u5728\u53f3\u4e0a\u89d2\uff0c\u4ee5 20px \u5927\u5c0f\u663e\u793a\uff0c\u5219\u4ee3\u7801\u662f\u8fd9\u6837\u7684\uff1a<\/p>\n<pre>border-image: url(...) 200 200 0 0 \/ 20 20 0 0 \/ 0;<\/pre>\n<p>\u662f\u4e0d\u662f\u6709\u4e9b\u4e0d\u7406\u89e3\uff1f\u90a3\u5c31\u5bf9\u4e86\uff0c\u300aCSS\u65b0\u4e16\u754c\u300b\u770b\u8d77\u6765\uff0c<code>border-image<\/code> \u8fd8\u662f\u6709\u4e9b\u5389\u5bb3\u7684\uff01<\/p>\n<h3>\u4e94\u3001\u626f\u70b9\u5176\u4ed6\u7684\u518d\u7ed3\u8bed<\/h3>\n<p>\u867d\u7136\u4e0d\u63a8\u8350\uff0c\u4f46\u662f\u96be\u514d\u6709\u4eba\u4f1a\u9047\u5230\u9700\u8981\u5bf9 <code>&lt;img&gt;<\/code> \u56fe\u50cf\u7b49\u66ff\u6362\u5143\u7d20\u8fdb\u884c\u70b9\u51fb\u53cd\u9988\u6548\u679c\u7684\u5b9e\u73b0\uff0c\u6b64\u65f6\uff0c\u672c\u6587\u63d0\u5230\u7684 3 \u79cd\u65b9\u6cd5\u5168\u90e8\u90fd\u662f\u4e2d\u56fd\u7537\u8db3\u2014\u2014\u51c9\u51c9\uff01<\/p>\n<pre>img:active {\r\n    \/* \u770b\u4e0d\u89c1 *\/\r\n    background-image: linear-gradient(rgba(0,0,0,.05), rgba(0,0,0,.05));\r\n    \/* \u770b\u4e0d\u89c1 + 1*\/\r\n    box-shadow: inset 0 0 0 999px rgba(0,0,0,.05);\r\n    \/* \u770b\u4e0d\u89c1 + 2 *\/\r\n    border-image: linear-gradient(rgba(0,0,0,.05), rgba(0,0,0,.05)) 1 fill;\r\n}<\/pre>\n<p>\u56e0\u4e3a\u56fe\u50cf\u5c5e\u4e8e\u5185\u5bb9\uff0c\u5c42\u53e0\u987a\u5e8f\u6bd4\u8f83\u9ad8\uff0c\u6b64\u65f6\u53ef\u4ee5\u4f7f\u7528\u6ee4\u955c\u5b9e\u73b0\uff1a<\/p>\n<pre>img:active {\r\n    filter: brightness(.95);\r\n}<\/pre>\n<p>\u672c\u6587\u6700\u540e\u90a3\u4e2a\u90ae\u7bb1\u8f93\u5165\u540e\u9762\u81ea\u52a8\u663e\u793a\u5bf9\u5e94\u9a8c\u8bc1\u56fe\u6807\u7684\u6848\u4f8b\u5176\u5b9e\u4e5f\u53ef\u4ee5\u4f7f\u7528 <code>background-image<\/code> \u6a21\u62df\u3002<\/p>\n<pre>.use-background {\r\n    border-right-width: 30px;\r\n    background: no-repeat right \/ 20px 20px;\r\n    background-origin: border-box;\r\n}\r\n.use-background:valid {\r\n    background-image: var(--valid);\r\n}\r\n.use-background:invalid:not(:placeholder-shown) {\r\n    background-image: var(--invalid);\r\n}<\/pre>\n<p>\u4e0d\u8fc7\u8fd9\u4e2a\u5b9e\u73b0\u867d\u7136\u89c6\u89c9\u4e0a\u597d\u50cf\u4e5f OK\uff0c\u4f46\u662f\uff0c\u53f3\u4fa7\u7684\u63d0\u793a\u56fe\u6807\u5360\u636e\u4e86\u5e03\u5c40\u7a7a\u95f4\uff0c\u5e76\u4e14\u662f\u8f93\u5165\u6846\u7684\u4e00\u90e8\u5206\uff0c\u70b9\u51fb\u662f\u80fd\u591f\u89e6\u53d1\u8f93\u5165\u6846\u7684 focus \u72b6\u6001\u7684\uff0c\u6ca1\u6709 <code>border-image<\/code> \u5b9e\u73b0\u7684\u4ea4\u4e92\u72b6\u6001\u597d\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202202\/input-valid-vs-bg.gif\" width=\"367\" height=\"195\" alt=\"\u5bf9\u6bd4\u793a\u610f\"><\/p>\n<p>\u597d\uff0c\u4ee5\u4e0a\u5c31\u662f\u672c\u6587\u7684\u5168\u90e8\u5185\u5bb9\u4e86\u3002<\/p>\n<p>\u5bf9\u4e86\uff0c\u6700\u8fd1\u5728\u81ea\u5df1\u72ec\u7acb\u5c0f\u8bf4\u7f51\u7ad9\u201c<a href=\"http:\/\/riziyan.com\/\" target=\"_riziyan\">\u65e5\u7d2b\u70df<\/a>\u201d\u66f4\u65b0\u767e\u4e07\u5b57\u957f\u7bc7\u8fde\u8f7d\u5c0f\u8bf4\uff0c\u8f7b\u5c0f\u8bf4\u5e26\u5947\u5e7b\uff0c\u6b22\u8fce\u54c1\u9274\uff0c<a href=\"http:\/\/riziyan.com\/category\/maze\/\" target=\"_riziyan\" class=\"a_link\">\u70b9\u51fb\u8fd9\u91cc\u5f00\u59cb\u9605\u8bfb<\/a>\u3002<\/p>\n<p>\u611f\u8c22\u9605\u8bfb\uff0c\u6b22\u8fce\u4e00\u952e\u4e09\u8fde\uff0c\u54e6\uff0c\u8d70\u9519\u573a\u4e86\uff0c\u4e0d\u662f\u89c6\u9891\uff0c\u90a3\u6b22\u8fce\u5206\u4eab\uff0c\u6bd4\u5fc3\u601d\u5bc6\u8fbe\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/\/image.zhangxinxu.com\/image\/emtion\/emoji\/2764.svg\" width=\"20\" height=\"20\" align=\"absmiddle\"><\/p>\n<p>\u672c\u6587\u4e3a\u539f\u521b\u6587\u7ae0\uff0c\u6b22\u8fce\u5206\u4eab\uff0c\u52ff\u5168\u6587\u8f6c\u8f7d\uff0c\u5982\u679c\u5b9e\u5728\u559c\u6b22\uff0c\u53ef\u6536\u85cf\uff0c\u6c38\u4e0d\u8fc7\u671f\uff0c\u4e14\u4f1a\u53ca\u65f6\u66f4\u65b0\u77e5\u8bc6\u70b9\u53ca\u4fee\u6b63\u9519\u8bef\uff0c\u9605\u8bfb\u4f53\u9a8c\u4e5f\u66f4\u597d\u3002<br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=10308\">https:\/\/www.zhangxinxu.com\/wordpress\/?p=10308<\/a><\/p>\n<p>\uff08\u672c\u7bc7\u5b8c\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202202\/border-image-s.png\" width=\"160\" height=\"96\" alt=\"border-image\u4f4d\u7f6e\" class=\"alignright size-medium\" loading=\"lazy\" \/><\/p>\n<p>\u6df1\u5165\u4ecb\u7ecd CSS border-image \u7684\u5386\u53f2\uff0c\u7279\u6027\u4ee5\u53ca\u5728\u67d0\u4e9b\u573a\u666f\u4e0b\u65e0\u53ef\u66ff\u4ee3\u7684\u4f5c\u7528\uff0c\u72ec\u5bb6\u5185\u5bb9\uff0c\u4e0d\u5bb9\u9519\u8fc7\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[389,298,1823,360,364,291],"_links":{"self":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/10308"}],"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=10308"}],"version-history":[{"count":0,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/10308\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/media?parent=10308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/categories?post=10308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/tags?post=10308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}