{"id":5793,"date":"2016-11-23T01:17:38","date_gmt":"2016-11-22T17:17:38","guid":{"rendered":"http:\/\/www.zhangxinxu.com\/wordpress\/?p=5793"},"modified":"2016-11-23T01:17:38","modified_gmt":"2016-11-22T17:17:38","slug":"css-text-decoration-underline-skip-override","status":"publish","type":"post","link":"https:\/\/www.zhangxinxu.com\/wordpress\/2016\/11\/css-text-decoration-underline-skip-override\/","title":{"rendered":"\u89e3\u51b3\u6587\u5b57\u548ctext-decoration:underline\u4e0b\u5212\u7ebf\u91cd\u53e0\u95ee\u9898"},"content":{"rendered":"<p>by <a href=\"http:\/\/www.zhangxinxu.com\/\">zhangxinxu<\/a> from <a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=5793\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=5793<\/a><br \/>\n\u672c\u6587\u53ef\u5168\u6587\u8f6c\u8f7d\uff0c\u4f46\u9700\u5f97\u5230\u539f\u4f5c\u8005\u4e66\u9762\u8bb8\u53ef\uff0c\u540c\u65f6\u4fdd\u7559\u539f\u4f5c\u8005\u548c\u51fa\u5904\uff0c\u6458\u8981\u5f15\u6d41\u5219\u968f\u610f\u3002<\/p>\n<h3>\u4e00\u3001text-decoration:underline\u4e0b\u5212\u7ebf\u7684\u95ee\u9898<\/h3>\n<p>CSS <code>text-decoration:underline<\/code>\u53ef\u4ee5\u7ed9\u5185\u8054\u6587\u672c\u589e\u52a0\u4e0b\u5212\u7ebf\uff0c\u4f46\u662f\uff0c\u5982\u679c\u5bf9\u7ec6\u8282\u8981\u6c42\u8f83\u9ad8\uff0c\u5c31\u4f1a\u53d1\u73b0\uff0c\u4e0b\u5212\u7ebf\u7ecf\u5e38\u4f1a\u548c\u4e2d\u6587\u6587\u5b57\u7684\u4e0b\u8fb9\u7f18\u641e\u5728\u4e00\u8d77\uff0c\u82f1\u6587\u7684\u8bdd\u751a\u81f3\u76f4\u63a5\u7a7f\u8d8a\uff0c\u770b\u8d77\u6765\u5c31\u6bd4\u8f83\u9999\u83c7\u84dd\u7626\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201611\/2016-11-21_213841.png\" width=\"78\" height=\"29\" alt=\"\u4e0b\u5212\u7ebf\u548c\u6587\u5b57\u5408\u5728\u4e00\u8d77\" class=\"alignnone\" \/><\/p>\n<p>\u4e0a\u56fe\u51e0\u4e2a\u4e2d\u6587\u4e0b\u8fb9\u7f18\u6b63\u597d\u90fd\u662f\u6a2a\u7ebf\uff0c\u7ed3\u679c\uff0c\u53ef\u4ee5\u770b\u5230\uff0c\u57fa\u672c\u4e0a\u5408\u5728\u4e00\u8d77\u5206\u4e0d\u6e05\u8c01\u662f\u8c01\u4e86\uff0c\u6362\u6210\u5fae\u8f6f\u96c5\u9ed1\u5b57\u4f53\uff08\u89c1\u4e0b\u56fe\uff09\uff0c\u4f3c\u4e4e\u53d8\u672c\u52a0\u5389\u4e86\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201611\/2016-11-21_214057.png\" width=\"77\" height=\"25\" alt=\"\u5fae\u8f6f\u96c5\u9ed1\u6587\u5b57\u4e0b\u5212\u7ebf\u91cd\u53e0\" class=\"alignnone\" \/><\/p>\n<p>\u6709\u6ca1\u6709\u4ec0\u4e48\u529e\u6cd5\u8ba9\u4e0b\u5212\u7ebf\u4e0d\u8981\u9760\u5f97\u8fd9\u4e48\u8fd1\uff0c\u6216\u8005\u6587\u5b57\u53ef\u4ee5\u5b8c\u6574\u6e05\u6670\u5730\u663e\u793a\u5462\uff1f<\/p>\n<p>\u6709\uff0c\u65b9\u6cd5\u8fd8\u4e0d\u5c11\uff0c\u4e0b\u9762\u9010\u4e00\u4ecb\u7ecd\uff0c\u5927\u5bb6\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u5b9e\u9645\u9879\u76ee\u9700\u6c42\uff0c\u9009\u62e9\u5408\u9002\u7684\u6280\u672f\u9009\u578b\u3002<\/p>\n<h3>\u65b9\u6cd5\u4e00\uff1atext-decoration-skip\u6307\u5b9a\u8986\u76d6\u5173\u7cfb<\/h3>\n<p>\u7406\u8bba\u4e0a\uff0c\u4f7f\u7528\u4e0b\u9762\u7684CSS\uff1a<\/p>\n<pre>a { text-decoration-skip: ink; }<\/pre>\n<p>\u673a\u4f1a\u6709\u7c7b\u4f3c\u4e0b\u56fe\u7684\u6548\u679c\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" width=\"536\" height=\"100\" alt=\"skip:ink\u7684\u6548\u679c\u622a\u56fe\u793a\u610f\" class=\"alignnone\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201506\/ink.png\"><\/p>\n<p><code>text-decoration-skip<\/code>\u662f<code>text-decoration<\/code>\u76f8\u5173\u7684CSS3\u65b0\u7684\u5c5e\u6027\uff0c\u8fd8\u6709\u5f88\u591a\u5176\u4ed6\u65b0\u7684CSS3 <code>text-decoration<\/code>\u5c5e\u6027\uff0c\u53ef\u4ee5\u6307\u5b9a\u4e0b\u5212\u7ebf\u7c7b\u578b\u7b49\uff0c\u5177\u4f53\u53ef\u53c2\u89c1\u6211\u4e4b\u524d\u7684\u6587\u7ae0\uff1a\u201c<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=4831\">\u4e86\u89e3CSS3 text-decoration\u65b0\u7279\u6027\u65b0\u8868\u73b0<\/a>\u201d\u3002<\/p>\n<p>\u770b\u4e0a\u53bb\u6548\u679c\u5f88\u4e0d\u9519\uff0c\u4f46\u662f\u9057\u61be\u7684\u662f\uff0c\u5373\u4f7f\u73b0\u5728\u5feb\u52302017\u5e74\u4e86\uff0c\u6b64\u5c5e\u6027\u7684\u6d4f\u89c8\u5668\u652f\u6301\u60c5\u51b5\u8fd8\u662f\u5f88\u4e0d\u4e50\u89c2\uff0c\u5305\u62ec\u5927\u5934Chrome\u6d4f\u89c8\u5668\u76ee\u524d\u5c1a\u672a\u652f\u6301\u3002<\/p>\n<blockquote><p>Safari 8+ supports -webkit-text-decoration-skip with values none and skip (other values behave like none or skip)<\/p><\/blockquote>\n<p>\u76ee\u524d\u4e5f\u5c31\u662fSafari 8+\u6d4f\u89c8\u5668\u652f\u6301\u5e26<code>-webkit-<\/code>\u79c1\u6709\u524d\u7f00\u7684<code>text-decoration-skip<\/code>\u5c5e\u6027\uff0c\u4e14\u4ec5\u4ec5\u652f\u6301<code>skip<\/code>\uff08\u9ed8\u8ba4\u503c\uff09\u548c<code>none<\/code>\u4e24\u4e2a\u503c\uff0c\u6362\u53e5\u8bdd\u8bf4\uff0cSafari 8+\u6d4f\u89c8\u5668\u9ed8\u8ba4\u4e0b\u5212\u7ebf\u5c31\u662f\u548c\u6587\u5b57\u975e\u7a7f\u8d8a\u800c\u662f\u907f\u8ba9\u6548\u679c\u3002\u8fd9\u8fdb\u4e00\u6b65\u5bfc\u81f4CSS\u4ee3\u7801\u4e2d\u6ca1\u6709<code>text-decoration-skip<\/code>\u5c5e\u6027\u51fa\u73b0\u7684\u5fc5\u8981\u4e86\u3002\u6240\u4ee5\uff0c\u6b64\u65b9\u6cd5\u867d\u7136\u6700\u539f\u751f\uff0c\u4f46\u65f6\u673a\u8fd8\u4e0d\u591f\u3002<\/p>\n<h3>\u65b9\u6cd5\u4e8c\uff1a\u4f7f\u7528border-bottom\u5c5e\u6027\u6a21\u62df<\/h3>\n<p>\u5185\u8054\u5143\u7d20\u867d\u7136\u4e0d\u652f\u6301\u5782\u76f4\u65b9\u5411\u7684<code>margin<\/code>\u5c5e\u6027\uff0c\u4f46\u662f\u652f\u6301\u5782\u76f4\u65b9\u5411\u7684<code>padding<\/code>\u5c5e\u6027\u548c<code>border<\/code>\u5c5e\u6027\uff0c\u5e76\u4e14\uff0c\u5bf9\u539f\u6765\u7684\u5e03\u5c40\u5b9a\u4f4d\u7b49\u6ca1\u6709\u4efb\u4f55\u5f71\u54cd\u3002\u56e0\u6b64\uff0c\u914d\u5408<code>padding<\/code>\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5f88\u6709\u6548\u5730\u8c03\u8282\u4e0b\u8fb9\u6846\u548c\u6587\u5b57\u4e0b\u8fb9\u7f18\u7684\u8ddd\u79bb\uff0c\u5b9e\u73b0\u6211\u4eec\u6700\u60f3\u8981\u7684\u7684\u6548\u679c\uff0c\u7c7b\u4f3c\u4e0b\u9762\u7684CSS\u4ee3\u7801\uff1a<\/p>\n<pre>a {\n    text-decoration: none;\n    border-bottom: 1px solid;\n}<\/pre>\n<p>\u6548\u679c\u7c7b\u4f3c\u4e0b\u56fe\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201611\/2016-11-21_222828.png\" width=\"276\" height=\"33\" alt=\"\u4e0b\u8fb9\u6846\u6a21\u62df\u7684\u4e0b\u5212\u7ebf\" class=\"alignnone\" \/><\/p>\n<p>\u5982\u679c\u89c9\u5f97<code>border-bottom<\/code>\u6a21\u62df\u7684\u4e0b\u5212\u7ebf\u8fd8\u662f\u548c\u6587\u5b57\u8d70\u5f97\u592a\u8fd1\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<code>padding-bottom<\/code>\u518d\u6491\u5f00\u70b9\u8ddd\u79bb\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre>a {\n    text-decoration: none;\n    border-bottom: 1px solid;\n    padding-bottom: 5px;\n}<\/pre>\n<p>\u5219\u6548\u679c\u7c7b\u4f3c\u4e0b\u9762\u622a\u56fe\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201611\/2016-11-21_223051.png\" width=\"413\" height=\"211\" alt=\"padding border\u914d\u5408\u7684\u4e0b\u5212\u7ebf\u6548\u679c\u622a\u56fe\" class=\"alignnone\" \/><\/p>\n<p>\u773c\u89c1\u4e3a\u5b9e\uff0c\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/study\/201611\/border-bottom-text-decoration-underline.html\" target=\"_blank\">border-bottom\u6a21\u62df\u4e0b\u5212\u7ebf\u6587\u5b57\u65e0\u91cd\u53e0demo<\/a><\/p>\n<p>\u6ce8\u610f\uff0c\u4f7f\u7528<code>border-bottom<\/code>\u6a21\u62df\u4e0b\u5212\u7ebf\u7684\u65f6\u5019\uff0c<code>border-color<\/code>\u6700\u597d\u7f3a\u7701\uff0c\u8fd9\u6837\u5c31\u4f1a\u4f7f\u7528\u6587\u5b57\u7684<code>color<\/code>\u989c\u8272\u4f5c\u4e3a\u8fb9\u6846\u8272\uff0c\u8fd9\u6837\uff0c\u9f20\u6807<code>hover<\/code>\u7684\u65f6\u5019\uff0c\u4e0b\u5212\u7ebf\u4f1a\u81ea\u52a8\u548c\u6587\u5b57\u4e00\u8d77\u53d8\u8272\uff0c\u7c7b\u4f3c\u4e0b\u56fe\u6548\u679c\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201611\/2016-11-21_223403.png\" width=\"287\" height=\"55\" alt=\"border\u6a21\u62df\u4e0b\u5212\u7ebfhover\u989c\u8272\u8ddf\u7740\u53d8\u5316\u6548\u679c\" class=\"alignnone\" \/><\/p>\n<p>\u4f7f\u7528<code>border-bottom<\/code>\u6a21\u62df\u7684\u53e6\u5916\u4e00\u4e2a\u597d\u5904\u5c31\u662f\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528\u865a\u7ebf\u4e0b\u5212\u7ebf\uff1a<\/p>\n<pre>a {\n    text-decoration: none;\n    border-bottom: 1px dashed;\n}<\/pre>\n<p>\u7c7b\u4f3c\u4e0b\u9762\u5b9e\u9645\u9879\u76ee\u9700\u6c42\u7684\u622a\u56fe\u5c31\u53ef\u4ee5\u4f7f\u7528\u8fd9\u79cd\u7b56\u7565\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201611\/link-ui.png\" width=\"377\" height=\"62\" alt=\"\u519b\u4e8b\u5f81\u6587\u4e0b\u5212\u7ebf\" class=\"alignnone\" \/><\/p>\n<h3>\u65b9\u6cd5\u4e09\uff1a\u4f7f\u7528box-shadow\u5c5e\u6027\u6a21\u62df<\/h3>\n<p>\u6211\u4eec\u4e5f\u53ef\u4ee5\u4f7f\u7528CSS3 <code>box-shadow<\/code>\u5c5e\u6027\u6a21\u62df\u4e0b\u5212\u7ebf\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre>a {\n    text-decoration: none;\n    box-shadow: 0 1px;\n}<\/pre>\n<p>\u540c\u6837\uff0c\u5efa\u8bae\u989c\u8272\u503c\u7f3a\u7701\uff0c\u4f7f\u7528<code>color<\/code>\u5c5e\u6027\u7684\u989c\u8272\u503c\u3002<\/p>\n<p>\u6548\u679c\u57fa\u672c\u4e0a\u548c<code>border-bottom<\/code>\u5982\u51fa\u4e00\u8f99\uff0c\u5982\u4e0b\u622a\u56fe\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201611\/2016-11-22_220110.png\" width=\"370\" height=\"144\" alt=\"box-shadow\u6a21\u62df\u4e0b\u5212\u7ebf\" class=\"alignnone\" \/><\/p>\n<p>\u773c\u89c1\u4e3a\u5b9e\uff0c\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/study\/201611\/box-shadow-text-decoration-underline.html\" target=\"_blank\">box-shadow\u6a21\u62df\u4e0b\u5212\u7ebf\u6548\u679cdemo<\/a><\/p>\n<p>\u76f8\u6bd4<code>border-bottom<\/code>\u5c5e\u6027\uff0c<code>box-shadow<\/code>\u7684\u4f18\u52bf\u5728\u4e8e\uff0c\u5373\u4f7f\u6211\u4eec\u628a\u5185\u8054\u5143\u7d20\u8bbe\u7f6e\u6210<code>display:inline-block<\/code>\uff0c\u751f\u6210\u7684\u4e0b\u5212\u7ebf\u4e5f\u4e0d\u4f1a\u5bf9\u5782\u76f4\u5bf9\u9f50\u6216\u8005\u5e03\u5c40\u4ea7\u751f\u5f71\u54cd\uff0c\u4f46\uff0c\u5982\u679c\u662f<code>border-bottom<\/code>\uff0c\u4f1a\u589e\u52a0\u5143\u7d20\u7684\u5c3a\u5bf8\uff0c\u53ef\u80fd\u5c31\u4f1a\u5f71\u54cd\u5143\u7d20\u7684\u6392\u5217\u3002<\/p>\n<p>\u4f46\u662f\uff0c<code>box-shadow<\/code>\u4e5f\u6709\u4e0d\u8db3\uff0c\u4e00\u662f\u517c\u5bb9\u6027\uff0cIE9+\u624d\u652f\u6301\uff0c\u4e8c\u662f\u53ea\u80fd\u5b9e\u7ebf\uff0c\u4e0d\u80fd\u865a\u7ebf\u3002<\/p>\n<h3>\u65b9\u6cd5\u56db\uff1a\u4f7f\u7528background-image\u5c5e\u6027\u6a21\u62df<\/h3>\n<p>\u5c31\u662f\u4f7f\u7528CSS3\u6e10\u53d8\u7ed8\u5236\u5b9e\u7ebf\u6216\u865a\u7ebf\u80cc\u666f\u56fe\u3002<\/p>\n<p>\u6548\u679c\u622a\u56fe\u5982\u4e0b\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201611\/2016-11-22_225839.png\" width=\"398\" height=\"178\" alt=\"\u4f7f\u7528background-image\u5b9e\u73b0\u7684\u4e0b\u5212\u7ebf\u6548\u679c\" class=\"alignnone\" \/><\/p>\n<p>\u76f8\u5173CSS\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre>.solid {\n    padding-bottom: 2px;\n    background-image: linear-gradient(to top, currentColor, currentColor 1px, transparent 1px);\n}\n.dashed {\n    padding-bottom: 2px;\n    background: linear-gradient(to right, currentColor, currentColor 4px, transparent 4px) repeat-x 0 bottom\/7px 1px;    \n}<\/pre>\n<p>\u7531\u4e8e\u80cc\u666f\u56fe\u7247\u662f\u5728\u539f\u672c\u533a\u57df\u5185\u663e\u793a\uff0c\u6709\u522b\u4e8e<code>border-bottom<\/code>\u6216\u8005<code>box-shadow<\/code>\u533a\u57df\u5916\u663e\u793a\uff0c\u56e0\u6b64\uff0c\u5b9e\u73b0\u7684\u4e0b\u5212\u7ebf\u5b9e\u9645\u4e0a\u548c\u6587\u5b57\u8fd8\u662f\u5f88\u8fd1\u7684\uff0c\u5c24\u5176\u7c7b\u4f3c<code>yqp<\/code>\u8fd9\u79cd\u57fa\u7ebf\u4ee5\u4e0b\u7684\u5b57\u6bcd\uff0c\u5c31\u4f1a\u5408\u4f53\u3002\u4e00\u822c\u6709\u4e24\u79cd\u5904\u7406\u624b\u6bb5\uff0c\u4e00\u79cd\u662f\u6587\u5b57\u589e\u52a0\u767d\u8272\u63cf\u8fb9\uff0c\u7c7b\u4f3c\u4e0b\u9762CSS\uff1a<\/p>\n<pre>a {\n    text-shadow: 0 1px #fff, 0 -1px #fff, 1px 0 #fff, -1px 0 #fff;\n}<\/pre>\n<p>\u6548\u679c\u7c7b\u4f3c\u4e0b\u9762\u8fd9\u6837\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201611\/2016-11-22_230353.png\" width=\"364\" height=\"88\" alt=\"\u6587\u5b57\u767d\u8272\u63cf\u8fb9\u5904\u7406\u91cd\u5408\u95ee\u9898\" class=\"alignnone\" \/><\/p>\n<p>\u7b2c\u4e8c\u79cd\u5c31\u662f\u4f7f\u7528<code>padding-bottom<\/code>\u5bf9\u5185\u8054\u5143\u7d20\u589e\u52a0\u53ef\u89c6\u9ad8\u5ea6\u3002\u6240\u4ee5\uff0c\u4e0a\u9762\u5b9e\u7ebf\u4e0b\u5212\u7ebf\u548c\u865a\u7ebf\u4e0b\u5212\u7ebf\u5747\u6709<code>padding-bottom:2px<\/code>\u7684\u8bbe\u7f6e\u3002<\/p>\n<p>\u773c\u89c1\u4e3a\u5b9e\uff0c\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/study\/201611\/background-image-text-decoration-underline.html\" target=\"_blank\">background-image\u6a21\u62df\u4e0b\u5212\u7ebf\u6548\u679cdemo<\/a><\/p>\n<p>\u5bf9\u4e86\uff0c\u7a81\u7136\u60f3\u8d77\u6765\uff0cdemo\u4e2d\u7684\u4e0b\u5212\u7ebf\u4f7f\u7528\u7684\u662f<code>currentColor<\/code>\u53d8\u91cf\uff0c\u4f46\u662f\u5728Chrome\u6d4f\u89c8\u5668\u548cIE\u6d4f\u89c8\u5668\u4e0b\uff0c<code>currentColor<\/code>\u4f5c\u4e3a\u80cc\u666f\u56fe\u7247\u8272\u503c\u7684\u65f6\u5019\uff0c\u5f53<code>:hover<\/code>\u6539\u53d8\u5143\u7d20\u7684<code>color<\/code>\u989c\u8272\u503c\u7684\u65f6\u5019\uff0c\u80cc\u666f\u56fe\u7247\u989c\u8272\u5e76\u4e0d\u4f1a\u8ddf\u7740\u53d8\uff0cFirefox\u6d4f\u89c8\u5668\u7684\u8868\u73b0\u7b26\u5408\u9884\u671f\uff0c\u56e0\u6b64\uff0c\u5982\u679c\u4f7f\u7528\u6b64\u65b9\u6cd5\uff0c\u9700\u8981<code>:hover<\/code>\u65f6\u5019\uff0c\u80cc\u666f\u56fe\u7247\u91cd\u65b0\u7ed8\u5236\u4e0b\u3002<\/p>\n<p>\u4f7f\u7528<code>background-image<\/code>\u7ed8\u5236\u7684\u597d\u5904\u5728\u4e8e\uff0c\u6211\u4eec\u5bf9\u6837\u5f0f\u7684\u63a7\u5236\u66f4\u7075\u6d3b\u7684\uff0c\u4f8b\u5982\u6211\u4eec\u53ef\u4ee5\u628a\u7ebf\u653e\u5728\u6587\u5b57\u7684\u540e\u9762\uff0c\u6211\u4eec\u53ef\u4ee5\u4e0a\u4e0b\u5212\u7ebf\uff0c\u6211\u4eec\u63a7\u5236\u865a\u7ebf\u7684\u7a00\u677e\u7a0b\u5ea6\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u4f7f\u7528\u5706\u70b9\u8868\u793a\u865a\u7ebf\uff0c\u6211\u4eec\u751a\u81f3\u4e5f\u53ef\u4ee5\u4f7f\u7528\u5f84\u5411\u6e10\u53d8\u7ed8\u5236\u6ce2\u6d6a\u6837\u5b50\u7684\u4e0b\u5212\u7ebf\uff0c\u751a\u81f3\u53ef\u4ee5\u628a\u7ebf\u505a\u6210\u503e\u659c\u7684\u7b49\u7b49\u3002\u4e0d\u8db3\u5728\u4e8eIE10+\u6d4f\u89c8\u5668\u624d\u652f\u6301\u3002<\/p>\n<h3>\u65b9\u6cd5\u4e94\uff1a\u4f7f\u7528SVG\u6ee4\u955c\u5904\u7406<\/h3>\n<p>\u8be5SVG\u6ee4\u955c\u76f8\u5173HTML\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre>&lt;svg class=\"out\"&gt;\n  &lt;filter id=\"svg-underline\" primitiveUnits=\"objectBoundingBox\"&gt;\n    <span style=\"color:green;\">&lt;!-- \u539f\u56fe\u6587\u57fa\u7840\u4e0a\u6c34\u5e73\u5782\u76f4\u65b9\u5411\u4e00\u70b9\u70b9\u6269\u5c55\u5e76\u5b58\u50a8\u5230\u65b0\u7684\u5c42\u4e0a --&gt;<\/span>\n    &lt;feMorphology in=\"SourceGraphic\" operator=\"dilate\" radius=\"0.0075 0.05\" result=\"outline\"&gt;&lt;\/feMorphology&gt;\n    <span style=\"color:green;\">&lt;!-- \u4e00\u4e2a\u84dd\u8272\u77e9\u5f62\uff0c\u9ad8\u5ea63%\u7136\u540e\u5bbd\u5ea6100%\uff0c\u4f4d\u7f6e\u7a0d\u5fae\u5f80\u4e0b\u4e00\u70b9 --&gt;<\/span>\n    &lt;feFlood flood-color=\"#34538b\" width=\"1\" height=\"0.03\" x=\"0\" y=\"0.9\" result=\"underline\"&gt;&lt;\/feFlood&gt;\n    <span style=\"color:green;\">&lt;!-- \u906e\u7f69\u84dd\u8272\u77e9\u5f62\uff0c\u8fd9\u6837\uff0c\u6587\u5b57\u91cd\u5408\u90e8\u5206\u8fb9\u7f18\u4f1a\u9542\u7a7a --&gt;<\/span>\n    &lt;feComposite in=\"underline\" in2=\"outline\" operator=\"out\" result=\"underline\"&gt;&lt;\/feComposite&gt;\n   <span style=\"color:green;\"> &lt;!-- \u6548\u679c\u5408\u4f53 --&gt;<\/span>\n    &lt;feMerge&gt;\n      &lt;feMergeNode in=\"underline\"&gt;&lt;\/feMergeNode&gt;\n      &lt;feMergeNode in=\"SourceGraphic\"&gt;&lt;\/feMergeNode&gt;\n    &lt;\/feMerge&gt;\n  &lt;\/filter&gt;\n&lt;\/svg&gt;\n<\/pre>\n<p>\u76f8\u5173CSS\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre>a {\n    -webkit-filter: url('#svg-underline');\n    filter: url('#svg-underline');\n    text-decoration: none;\n}<\/pre>\n<p>\u7136\u540e\uff0c\u5b9e\u73b0\u7684\u6548\u679c\u7c7b\u4f3c\u4e0b\u9762\u7684\u622a\u56fe\uff08\u622a\u81eaChrome\u6d4f\u89c8\u5668\uff09\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201611\/2016-11-22_234643.png\" width=\"580\" height=\"204\" alt=\"SVG\u6ee4\u955c\u5b9e\u73b0\u7684\u4e0b\u5212\u7ebf\" class=\"alignnone\" \/><\/p>\n<p>\u770b\u4e0a\u53bb\u5f88\u9ebb\u70e6\u5f88\u5570\u55e6\uff0chover\u53d8\u8272\u8fd8\u9700\u8981\u53e6\u5916\u7684\u5904\u7406\uff0cSVG\u6ee4\u955c\u517c\u5bb9\u6027\u5e76\u4e0d\u4e50\u89c2\uff0cIE\u73b0\u5728\u90fd\u4e0d\u652f\u6301\uff0c\u6240\u4ee5\uff0c\u8fd9\u79cd\u65b9\u6cd5\u7684\u610f\u4e49\u5728\u54ea\u91cc\uff1f<\/p>\n<p>\u610f\u4e49\u5c31\u5728\u4e8e\u53ef\u4ee5\u5b9e\u73b0\u771f\u6b63\u610f\u4e49\u4e0a\u7684<code>text-decoration-skip<\/code>\u6548\u679c\uff0c\u4e5f\u5c31\u662f\u4e0b\u5212\u7ebf\u548c\u6587\u5b57\u91cd\u53e0\u7684\u4f4d\u7f6e\u81ea\u52a8\u4ece\u6587\u5b57\u4e0b\u9762\u7a7f\u8fc7\uff0c\u5e76\u4e14\u9644\u8fd1\u5b8c\u5168\u662f\u771f\u6b63\u7684\u900f\u660e\uff0c\u4ed4\u7ec6\u770b\u4e0a\u9762\u622a\u56fe\uff0c\u53ef\u4ee5\u770b\u5230\uff0c\u6587\u5b57\u548c\u4e0b\u5212\u7ebf\u63a5\u89e6\u7684\u4f4d\u7f6e\u7684\u5730\u65b9\uff0c\u770b\u4e0a\u53bb\u67091\u50cf\u7d20\u7684\u63a5\u89e6\u70b9\u662f\u900f\u660e\u7684\u3002<\/p>\n<p>\u539f\u751f\u7684Safari\u5916\u52a0SVG\u6ee4\u955c\u4e0b\u7684Chrome\/Firefox\uff0c\u4e5f\u5c31\u662f\u7edd\u5927\u591a\u6570\u6d4f\u89c8\u5668\u90fd\u53ef\u4ee5\u5b9e\u73b0\u4e0b\u5212\u7ebf\u548c\u6587\u5b57\u81ea\u52a8\u63a5\u89e6\u70b9\u9542\u7a7a\u7684\u6548\u679c\u3002<\/p>\n<p>\u773c\u89c1\u4e3a\u5b9e\uff0c\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/study\/201611\/svg-filter-text-decoration-underline.html\" target=\"_blank\">\u4f7f\u7528SVG\u6ee4\u955c\u6a21\u62df\u4e0b\u5212\u7ebfdemo<\/a><\/p>\n<h3>\u65b9\u6cd5\u516d\uff1a\u4f7f\u7528canvas\u5b9e\u73b0\uff08\u8457\u540d\u7684Underline.js\uff09<\/h3>\n<p>Underline.js\u9879\u76ee\u5730\u5740\uff1ahttps:\/\/github.com\/wentin\/underlineJS<\/p>\n<p>\u4f5c\u8005\u662f\u8fd9\u4f4d\u59b9\u7eb8\uff08\u56fe\u7247\u6e90\u81ea\u7f51\u7edc\uff09\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201611\/wenting.jpg\" width=\"150\" height=\"150\" alt=\"\u6587\u5a77\" class=\"alignnone\" \/><\/p>\n<p>zhangwenting\uff0c\u76ee\u524d\u4efb\u804c\u4e8e Adobe Typekit\u3002<\/p>\n<p>underline.js\u540c\u6837\u5b9e\u73b0\u7684\u662f\u4e0b\u5212\u7ebf\u548c\u6587\u5b57\u91cd\u53e0\u81ea\u52a8\u907f\u8ba9\u7684\u6548\u679c\uff0c\u7c7b\u4f3c\u4e0b\u56fe\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201611\/underline.js.png\" width=\"450\" height=\"244\" alt=\"underline.js\u5b9e\u73b0\u6548\u679c\u793a\u610f\" class=\"alignnone\" \/><\/p>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/study\/201611\/canvas-js-text-decoration-underline.html\" target=\"_blank\">canvas\u539f\u7406\u7684underline.js\u89e3\u51b3\u4e0b\u5212\u7ebf\u91cd\u53e0demo<\/a><\/p>\n<p>\u57fa\u672c\u4e0a\uff0c\u4e0b\u5212\u7ebf\u6587\u5b57\u7a7f\u8d8a\u6548\u679c\u53ea\u6709\u82f1\u6587\u624d\u597d\u770b\uff0c\u4e2d\u6587\u5982\u679c\u7a7f\u8d8a\uff0c\u6211\u53bb\uff0c\u57fa\u672c\u4e0a\u4e0b\u5212\u7ebf\u5c31\u6ca1\u4e86\uff0c\u5c24\u5176\u7c7b\u4f3c\u201c\u91d1\u7389\u5168\u738b\u201d\u8fd9\u6837\u7684\u6c49\u5b57\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201611\/2016-11-23_005059.png\" width=\"442\" height=\"94\" alt=\"\u4e0b\u5212\u7ebf\u7a7f\u8d8a\u6548\u679c\" class=\"alignnone\" \/><\/p>\n<p>\u6240\u4ee5\uff0c\u5bf9\u4e8e\u4e2d\u6587\uff0c\u6700\u597d\u7684\u6548\u679c\u8fd8\u662f\u907f\u8ba9\uff0c\u5c31\u662f\u76f4\u63a5\u7ebf\u548c\u6587\u5b57\u7559\u70b9\u8ddd\u79bb\uff0c\u8fd9\u6837\u662f\u6700\u597d\u7684\u3002\u5bf9\u4e8e\uff0c\u82f1\u6587\u4e3a\u4e3b\u7684\u5185\u5bb9\uff0c\u5219<code>text-decoration-skip<\/code>\u6548\u679c\u786e\u5b9e\u8fd8\u662f\u633a\u6709\u4ef7\u503c\u7684\u3002<\/p>\n<p>\u6839\u636e\u6211\u81ea\u5df1\u5bf9underline.js\u7684\u4f7f\u7528\uff0c\u53d1\u73b0\uff0c\u5c40\u9650\u6027\u8fd8\u4e0d\u5c0f\uff0c\u5185\u8054\u5143\u7d20\u6700\u597d\u8981<code>inline-block<\/code>\u5316\uff0c\u7eaf<code>inline<\/code>\u751f\u6210\u7684canvas\u7684\u5782\u76f4\u4f4d\u7f6e\u4e0d\u662f\u5f88\u7cbe\u51c6\uff0c\u7136\u540e\uff0c\u4e0d\u652f\u6301\u6587\u5b57\u81ea\u52a8\u6362\u884c\u4e0b\u5212\u7ebf\u6298\u7ebf\u663e\u793a\uff0c\u6bd5\u7adfcanvas\u5143\u7d20\u662f\u4e2a\u72ec\u7acb\u7684\u66ff\u6362\u5143\u7d20\uff0c\u8ddf\u56fe\u7247\u4e00\u6837\uff0c\u4e0d\u53ef\u80fd\u6362\u884c\u65f6\u5019\u5206\u4e00\u534a\u4e0a\u9762\u518d\u4e00\u534a\u4e0b\u9762\u3002<\/p>\n<p>\u57fa\u672c\u4e0a\uff0c\u9002\u5408\u7528\u5728\u5c40\u90e8\u4e00\u4e9b\u5927\u7684\u6807\u8bed\uff0c\u6807\u9898\uff0cslogon\u7b49\u4f4d\u7f6e\u6216\u8005\u8ffd\u6c42\u89c6\u89c9\u7684\u5b98\u65b9\u7f51\u7ad9\u6216\u6d3b\u52a8\u9875\u9762\u4e0a\u4f7f\u7528\u3002<\/p>\n<h3>\u516b\u3001\u7ed3\u675f\u8bed<\/h3>\n<p>\u4eca\u5929\u7fa4\u91cc\u90fd\u5728\u73a9\u98ce\u666f\u7167\u4e00\u4e0b\u5b50\u53d8\u6210\u52a8\u6f2b\u98ce\u683c\u7684\u6ee4\u955c\uff0c\u5b9e\u9645\u4e0a\uff0c\u4f7f\u7528PS\uff0c\u5206\u5206\u949f\u641e\u5b9a\u3002<\/p>\n<p>\u6211\u7279\u610f\u627e\u4e86\u5f20\u8d28\u91cf\u5f88\u5dee\u7684\u81ea\u5df1\u9493\u9c7c\u62cd\u7684\u98ce\u666f\u56fe\uff0cPS\u4e2d\u6ee4\u955c\u641e\u641e\uff0c2\u5206\u949f\uff0c\u5c31\u597d\u4e86\uff0c\u6548\u679c\u5982\u4e0b\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/ww1.sinaimg.cn\/mw690\/4b4d632fgw1fa1du9wq4bj20go0isq6i.jpg\" width=\"600\" height=\"676\" alt=\"\u9493\u9c7c\u98ce\u666f\u56fe\u53d8\u6c34\u5f69\u52a8\u6f2b\u98ce\u683c\" class=\"alignnone\" \/><\/p>\n<p>\u6548\u679c\u8fd8\u884c\uff0c\u5982\u679c\u6362\u4e2a\u6e05\u6670\u660e\u4e3d\u7684\u56fe\uff0c\u6548\u679c\u4f1a\u66f4\u597d\u3002<\/p>\n<p>\u6b65\u9aa4\u5982\u4e0b\uff1a<br \/>\n1. \u6ee4\u955c\u2192\u6ee4\u955c\u5e93\u2192\u5e72\u753b\u7b14\u21920 10 1\uff01<br \/>\n2. \u6ee4\u955c\u2192Camera Raw\u6ee4\u955c\u2192\u8272\u6e29\u9ad8\uff0c\u8272\u8c03\u7eff\uff0c\u66dd\u5149\u589e\u52a0\uff0c\u5bf9\u6bd4\u5bf9\u589e\u52a0\uff0c\u9634\u5f71\u548c\u9ed1\u8272\u6700\u5927\uff0c\u9971\u548c\u5ea6\u548c\u6e05\u6670\u5ea6\u9002\u5f53\u589e\u52a0\uff0c\u7136\u540e\u7b2c\u4e09\u4e2a\u201c\u7ec6\u8282\u201d\u5c0f\u6309\u94ae\uff0c\u6570\u91cf\u548c\u8499\u7248\u5f88\u5927\u7684\u503c\uff0c\u534a\u5f84\u548c\u7ec6\u8282\u81ea\u5df1\u770b\u7740\u8c03\uff1b<br \/>\n3. done!<\/p>\n<p>\u672c\u6587\u5185\u5bb9\u53c2\u8003\u81ea\uff1a<a href=\"https:\/\/css-tricks.com\/styling-underlines-web\/\" target=\"_blank\">Styling Underlines on the Web<\/a><\/p>\n<p>\u611f\u8c22\u9605\u8bfb\uff0c\u6b22\u8fce\u4ea4\u6d41\uff01<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201611\/14.png\" align=\"absmiddle\"><\/p>\n<p>\u672c\u6587\u4e3a\u539f\u521b\u6587\u7ae0\uff0c\u4f1a\u7ecf\u5e38\u66f4\u65b0\u77e5\u8bc6\u70b9\u4ee5\u53ca\u4fee\u6b63\u4e00\u4e9b\u9519\u8bef\uff0c\u56e0\u6b64\u8f6c\u8f7d\u8bf7\u4fdd\u7559\u539f\u51fa\u5904\uff0c\u65b9\u4fbf\u6eaf\u6e90\uff0c\u907f\u514d\u9648\u65e7\u9519\u8bef\u77e5\u8bc6\u7684\u8bef\u5bfc\uff0c\u540c\u65f6\u6709\u66f4\u597d\u7684\u9605\u8bfb\u4f53\u9a8c\u3002<br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=5793\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=5793<\/a><\/p>\n<p>\uff08\u672c\u7bc7\u5b8c\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CSS text-decoration:underline\u53ef\u4ee5\u7ed9\u5185\u8054\u6587\u672c\u589e\u52a0\u4e0b\u5212\u7ebf\uff0c\u4f46\u662f\uff0c\u5982\u679c\u5bf9\u7ec6\u8282\u8981\u6c42\u8f83\u9ad8\uff0c\u5c31\u4f1a\u53d1\u73b0\uff0c\u4e0b\u5212\u7ebf\u7ecf\u5e38\u4f1a\u548c\u4e2d\u6587\u6587\u5b57\u7684\u4e0b\u8fb9\u7f18\u641e\u5728\u4e00\u8d77\uff0c\u82f1\u6587\u7684\u8bdd\u751a\u81f3\u76f4\u63a5\u7a7f\u8d8a\uff0c\u770b\u8d77\u6765\u5c31\u6bd4\u8f83\u9999\u83c7\u84dd\u7626\u3002<\/p>\n<p>\u6709\u6ca1\u6709\u4ec0\u4e48\u529e\u6cd5\u8ba9\u4e0b\u5212\u7ebf\u4e0d\u8981\u9760\u5f97\u8fd9\u4e48\u8fd1\uff0c\u6216\u8005\u6587\u5b57\u53ef\u4ee5\u5b8c\u6574\u6e05\u6670\u5730\u663e\u793a\u5462\uff1f<\/p>\n<p>\u6709\uff0c\u65b9\u6cd5\u8fd8\u4e0d\u5c11\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],"tags":[389,360,53,368,364,996,999],"_links":{"self":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/5793"}],"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=5793"}],"version-history":[{"count":0,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/5793\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/media?parent=5793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/categories?post=5793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/tags?post=5793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}