我们使用标签来删除HTML中的文本。该标签标记在要从文档中删除的文本上。
我们还可以使用 style 属性来删除 HTML 中的文本。 style 属性指定元素的内联样式。此属性在 HTML
标记内部与 CSS 属性 text-decoration 属性一起使用。
以下是删除 HTML 中文本的语法。
<del> The content to be deleted </del>
以下是删除HTML文本的示例程序。
<!DOCTYPE html> <html> <head> </head> <body> <p>DLF stands for<del>Delhi Land and Finance.</del></p> <p>Delhi Land and Finance is one of the largest commercial real estate developer in India.</p> </body> </html>
在下面的示例中,我们在
<!DOCTYPE html> <html> <head> <title>HTML u tag</title> </head> <body> <h1>Welcome to <del> Disney land </del> Kids.</h1> </body> </html>
使用CSS属性在HTML中删除文本。
以下是使用CSS属性删除HTML中文本的语法。
<p style="text decoration:line-through;">The content to be underlined</p>
以下是使用 CSS 属性删除 HTML 中文本的示例程序。
<!DOCTYPE html> <html> <head> </head> <body> <p>DLF stands for</p><p style="text-decoration:line-through;">Delhi Land and Finance</p> <p>Delhi Land and Finance is one of the largest commercial real estate developer in India.</p> </body> </html>