{"id":63,"date":"2025-11-20T16:55:51","date_gmt":"2025-11-20T08:55:51","guid":{"rendered":"https:\/\/www.52runoob.com\/?p=63"},"modified":"2025-11-20T16:55:51","modified_gmt":"2025-11-20T08:55:51","slug":"html%e6%80%8e%e4%b9%88%e8%ae%be%e7%bd%ae%e4%b8%8b%e5%88%92%e7%ba%bfhtml%e6%96%87%e5%ad%97%e5%8a%a0%e4%b8%8b%e5%88%92%e7%ba%bf%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.52runoob.com\/index.php\/2025\/11\/20\/html%e6%80%8e%e4%b9%88%e8%ae%be%e7%bd%ae%e4%b8%8b%e5%88%92%e7%ba%bfhtml%e6%96%87%e5%ad%97%e5%8a%a0%e4%b8%8b%e5%88%92%e7%ba%bf%e6%96%b9%e6%b3%95\/","title":{"rendered":"HTML\u600e\u4e48\u8bbe\u7f6e\u4e0b\u5212\u7ebf?html\u6587\u5b57\u52a0\u4e0b\u5212\u7ebf\u65b9\u6cd5"},"content":{"rendered":"\n<p>\u5728 HTML \u4e2d\uff0c\u7ed9\u6587\u5b57\u52a0\u4e0b\u5212\u7ebf\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u6cd5\u5b9e\u73b0\u3002\u4ee5\u4e0b\u662f\u51e0\u79cd\u5e38\u89c1\u7684\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1.&nbsp;<strong>\u4f7f\u7528&nbsp;<code>&lt;u&gt;<\/code>&nbsp;\u6807\u7b7e<\/strong><\/h3>\n\n\n\n<p>HTML \u4e2d\u6700\u76f4\u63a5\u7684\u65b9\u5f0f\u662f\u4f7f\u7528&nbsp;<code>&lt;u&gt;<\/code>&nbsp;\u6807\u7b7e\uff0c\u5b83\u4e13\u95e8\u7528\u4e8e\u7ed9\u6587\u672c\u6dfb\u52a0\u4e0b\u5212\u7ebf\u3002\u867d\u7136\u8fd9\u4e2a\u6807\u7b7e\u5728 HTML5 \u4e2d\u5df2\u4e0d\u63a8\u8350\u7528\u4e8e\u8bed\u4e49\u5316\u6807\u8bb0\uff0c\u4f46\u5b83\u4ecd\u7136\u6709\u6548\uff0c\u9002\u7528\u4e8e\u7b80\u5355\u7684\u6587\u5b57\u4e0b\u5212\u7ebf\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;!DOCTYPE html&gt;\n&amp;lt;html lang=&quot;en&quot;&gt;\n&amp;lt;head&gt;\n    &amp;lt;meta charset=&quot;UTF-8&quot;&gt;\n    &amp;lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;\n    &amp;lt;title&gt;\u4e0b\u5212\u7ebf\u793a\u4f8b&amp;lt;\/title&gt;\n&amp;lt;\/head&gt;\n&amp;lt;body&gt;\n\n    &amp;lt;p&gt;This is a &amp;lt;u&gt;text with underline&amp;lt;\/u&gt;.&amp;lt;\/p&gt;\n\n&amp;lt;\/body&gt;\n&amp;lt;\/html&gt;\n\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\">\u89e3\u91ca\uff1a<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>&lt;u><\/code>\u00a0\u6807\u7b7e\u8868\u793a\u201c\u4e0b\u5212\u7ebf\u201d\uff0c\u5b83\u5c06\u6587\u672c\u76f4\u63a5\u7528\u4e0b\u5212\u7ebf\u5305\u88f9\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">2.&nbsp;<strong>\u4f7f\u7528 CSS \u7684&nbsp;<code>text-decoration<\/code>&nbsp;\u5c5e\u6027<\/strong><\/h3>\n\n\n\n<p>CSS \u63d0\u4f9b\u4e86\u66f4\u7075\u6d3b\u548c\u63a8\u8350\u7684\u65b9\u5f0f\u6765\u5b9e\u73b0\u4e0b\u5212\u7ebf\u6548\u679c\uff0c\u5373\u4f7f\u7528&nbsp;<code>text-decoration<\/code>&nbsp;\u5c5e\u6027\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u8be5\u5c5e\u6027\u5728\u5143\u7d20\u4e0a\u5e94\u7528\u4e0b\u5212\u7ebf\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u793a\u4f8b\u4ee3\u7801\uff1a<\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;!DOCTYPE html&gt;\n&amp;lt;html lang=&quot;en&quot;&gt;\n&amp;lt;head&gt;\n    &amp;lt;meta charset=&quot;UTF-8&quot;&gt;\n    &amp;lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;\n    &amp;lt;title&gt;\u4e0b\u5212\u7ebf\u793a\u4f8b&amp;lt;\/title&gt;\n    &amp;lt;style&gt;\n        .underline {\n            text-decoration: underline;\n        }\n    &amp;lt;\/style&gt;\n&amp;lt;\/head&gt;\n&amp;lt;body&gt;\n\n    &amp;lt;p&gt;This is a &amp;lt;span class=&quot;underline&quot;&gt;text with underline using CSS&amp;lt;\/span&gt;.&amp;lt;\/p&gt;\n\n&amp;lt;\/body&gt;\n&amp;lt;\/html&gt;\n\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\">\u89e3\u91ca\uff1a<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>text-decoration: underline;<\/code>\u00a0\u901a\u8fc7 CSS \u8bbe\u7f6e\u4e0b\u5212\u7ebf\uff0c\u53ef\u4ee5\u7075\u6d3b\u5730\u63a7\u5236\u5143\u7d20\u7684\u6837\u5f0f\uff0c\u5e76\u4e14\u4e0d\u4f9d\u8d56\u4e8e HTML \u6807\u7b7e\u672c\u8eab\u3002<\/li>\n\n\n\n<li>\u901a\u8fc7\u7ed9\u5143\u7d20\u6dfb\u52a0\u7c7b\u00a0<code>.underline<\/code>\uff0c\u4f60\u53ef\u4ee5\u5c06\u4e0b\u5212\u7ebf\u6837\u5f0f\u5e94\u7528\u5230\u4efb\u4f55\u4f60\u60f3\u8981\u7684\u5143\u7d20\u4e0a\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">3.&nbsp;<strong>\u4f7f\u7528 CSS&nbsp;<code>border-bottom<\/code>&nbsp;\u5c5e\u6027\uff08\u521b\u5efa\u81ea\u5b9a\u4e49\u4e0b\u5212\u7ebf\uff09<\/strong><\/h3>\n\n\n\n<p>\u5982\u679c\u4f60\u60f3\u8981\u66f4\u7cbe\u786e\u6216\u81ea\u5b9a\u4e49\u7684\u4e0b\u5212\u7ebf\u6837\u5f0f\uff08\u4f8b\u5982\uff0c\u63a7\u5236\u4e0b\u5212\u7ebf\u7684\u989c\u8272\u3001\u5bbd\u5ea6\u6216\u6837\u5f0f\uff09\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528&nbsp;<code>border-bottom<\/code>\u5c5e\u6027\u6765\u6a21\u62df\u4e0b\u5212\u7ebf\u6548\u679c\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u793a\u4f8b\u4ee3\u7801\uff1a<\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;!DOCTYPE html&gt;\n&amp;lt;html lang=&quot;en&quot;&gt;\n&amp;lt;head&gt;\n    &amp;lt;meta charset=&quot;UTF-8&quot;&gt;\n    &amp;lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;\n    &amp;lt;title&gt;\u4e0b\u5212\u7ebf\u793a\u4f8b&amp;lt;\/title&gt;\n    &amp;lt;style&gt;\n        .custom-underline {\n            border-bottom: 2px solid red; \/* \u7ea2\u8272\u4e0b\u5212\u7ebf\uff0c2px \u5bbd *\/\n            display: inline;  \/* \u786e\u4fdd\u6587\u5b57\u5728\u540c\u4e00\u884c\u5185 *\/\n        }\n    &amp;lt;\/style&gt;\n&amp;lt;\/head&gt;\n&amp;lt;body&gt;\n\n    &amp;lt;p&gt;This is a &amp;lt;span class=&quot;custom-underline&quot;&gt;custom underlined text&amp;lt;\/span&gt;.&amp;lt;\/p&gt;\n\n&amp;lt;\/body&gt;\n&amp;lt;\/html&gt;\n\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\">\u89e3\u91ca\uff1a<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>border-bottom<\/code>\u00a0\u521b\u5efa\u4e86\u4e00\u4e2a\u4e0b\u5212\u7ebf\u7684\u6548\u679c\uff0c\u5e76\u4e14\u4f60\u53ef\u4ee5\u81ea\u5b9a\u4e49\u989c\u8272\u3001\u5bbd\u5ea6\u548c\u6837\u5f0f\u3002<\/li>\n\n\n\n<li><code>display: inline;<\/code>\u00a0\u786e\u4fdd\u6587\u672c\u5143\u7d20\u4e0d\u4f1a\u6539\u53d8\u5e03\u5c40\uff0c\u800c\u662f\u4fdd\u6301\u4e0e\u5176\u4ed6\u6587\u672c\u5143\u7d20\u5728\u540c\u4e00\u884c\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">4.&nbsp;<strong>\u4f7f\u7528&nbsp;<code>text-decoration<\/code>&nbsp;\u5c5e\u6027\u7684\u5176\u4ed6\u9009\u9879<\/strong><\/h3>\n\n\n\n<p>CSS \u7684&nbsp;<code>text-decoration<\/code>&nbsp;\u5c5e\u6027\u9664\u4e86\u53ef\u4ee5\u8bbe\u7f6e\u4e3a&nbsp;<code>underline<\/code>\uff0c\u8fd8\u53ef\u4ee5\u8bbe\u7f6e\u5176\u4ed6\u503c\uff0c\u5982&nbsp;<code>overline<\/code>\u3001<code>line-through<\/code>&nbsp;\u548c&nbsp;<code>none<\/code>\u3002\u8fd9\u4e9b\u503c\u53ef\u4ee5\u5206\u522b\u5b9e\u73b0\u4e0a\u5212\u7ebf\u3001\u5220\u9664\u7ebf\u548c\u53bb\u9664\u4e0b\u5212\u7ebf\u6548\u679c\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u793a\u4f8b\u4ee3\u7801\uff1a<\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;!DOCTYPE html&gt;\n&amp;lt;html lang=&quot;en&quot;&gt;\n&amp;lt;head&gt;\n    &amp;lt;meta charset=&quot;UTF-8&quot;&gt;\n    &amp;lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;\n    &amp;lt;title&gt;\u4e0b\u5212\u7ebf\u793a\u4f8b&amp;lt;\/title&gt;\n    &amp;lt;style&gt;\n        .underline {\n            text-decoration: underline;\n        }\n\n        .line-through {\n            text-decoration: line-through;\n        }\n\n        .overline {\n            text-decoration: overline;\n        }\n\n        .no-decoration {\n            text-decoration: none;\n        }\n    &amp;lt;\/style&gt;\n&amp;lt;\/head&gt;\n&amp;lt;body&gt;\n\n    &amp;lt;p&gt;This is a &amp;lt;span class=&quot;underline&quot;&gt;underlined text&amp;lt;\/span&gt;.&amp;lt;\/p&gt;\n    &amp;lt;p&gt;This is a &amp;lt;span class=&quot;line-through&quot;&gt;strikethrough text&amp;lt;\/span&gt;.&amp;lt;\/p&gt;\n    &amp;lt;p&gt;This is an &amp;lt;span class=&quot;overline&quot;&gt;overlined text&amp;lt;\/span&gt;.&amp;lt;\/p&gt;\n    &amp;lt;p&gt;This is a &amp;lt;span class=&quot;no-decoration&quot;&gt;text without decoration&amp;lt;\/span&gt;.&amp;lt;\/p&gt;\n\n&amp;lt;\/body&gt;\n&amp;lt;\/html&gt;\n\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\">\u89e3\u91ca\uff1a<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>text-decoration: line-through;<\/code>\uff1a\u6dfb\u52a0\u5220\u9664\u7ebf\uff08\u4e2d\u5212\u7ebf\uff09\u3002<\/li>\n\n\n\n<li><code>text-decoration: overline;<\/code>\uff1a\u6dfb\u52a0\u4e0a\u5212\u7ebf\u3002<\/li>\n\n\n\n<li><code>text-decoration: none;<\/code>\uff1a\u79fb\u9664\u4efb\u4f55\u6587\u672c\u88c5\u9970\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u603b\u7ed3<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>&lt;u><\/code>\u00a0\u6807\u7b7e<\/strong>\uff1a\u76f4\u63a5\u5e94\u7528\u4e8e\u6587\u672c\uff0c\u4f46 HTML5 \u4e2d\u5df2\u4e0d\u63a8\u8350\u4f7f\u7528\uff0c\u9664\u975e\u662f\u7528\u4e8e\u8868\u793a\u8bed\u4e49\u4e0a\u7684\u201c\u4e0b\u5212\u7ebf\u201d\u3002<\/li>\n\n\n\n<li><strong><code>text-decoration: underline<\/code><\/strong>\uff1a\u66f4\u63a8\u8350\u7684\u65b9\u5f0f\uff0c\u901a\u8fc7 CSS \u63a7\u5236\u5143\u7d20\u7684\u4e0b\u5212\u7ebf\u6837\u5f0f\uff0c\u53ef\u4ee5\u7075\u6d3b\u7ba1\u7406\u548c\u5e94\u7528\u3002<\/li>\n\n\n\n<li><strong><code>border-bottom<\/code><\/strong>\uff1a\u9002\u7528\u4e8e\u9700\u8981\u66f4\u7cbe\u786e\u63a7\u5236\u4e0b\u5212\u7ebf\u6837\u5f0f\uff08\u5982\u989c\u8272\u3001\u5bbd\u5ea6\u3001\u7ebf\u578b\u7b49\uff09\u65f6\u4f7f\u7528\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528&nbsp;<strong><code>text-decoration: underline<\/code><\/strong>&nbsp;\u662f\u6700\u4e3a\u7b80\u6d01\u548c\u63a8\u8350\u7684\u65b9\u6cd5\uff0c\u800c&nbsp;<strong><code>border-bottom<\/code><\/strong>&nbsp;\u5219\u53ef\u4ee5\u6ee1\u8db3\u66f4\u9ad8\u7ea7\u7684\u6837\u5f0f\u9700\u6c42\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 HTML \u4e2d\uff0c\u7ed9\u6587\u5b57\u52a0\u4e0b\u5212\u7ebf\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u6cd5\u5b9e\u73b0\u3002\u4ee5\u4e0b\u662f\u51e0\u79cd\u5e38\u89c1\u7684\u65b9\u6cd5\uff1a 1&#8230; <a class=\"more-link\" href=\"https:\/\/www.52runoob.com\/index.php\/2025\/11\/20\/html%e6%80%8e%e4%b9%88%e8%ae%be%e7%bd%ae%e4%b8%8b%e5%88%92%e7%ba%bfhtml%e6%96%87%e5%ad%97%e5%8a%a0%e4%b8%8b%e5%88%92%e7%ba%bf%e6%96%b9%e6%b3%95\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-63","post","type-post","status-publish","format-standard","hentry","category-html-xhtml"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/63","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/comments?post=63"}],"version-history":[{"count":1,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/63\/revisions"}],"predecessor-version":[{"id":64,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/63\/revisions\/64"}],"wp:attachment":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/media?parent=63"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/categories?post=63"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/tags?post=63"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}