首页 > 文章列表 > 如何在HTML中标记插入的文本?

如何在HTML中标记插入的文本?

495 2023-09-12

要插入的内容用下划线标记。下划线文本用于帮助吸引注意力。

我们使用<ins>标签在HTML中标记文本。它表示网页内容中与其他文本样式不同的文本

我们还可以使用 style 属性来标记 HTML 中的文本。 style 属性指定元素的内联样式。此属性在 HTML

标记内部与 CSS 属性 text-decoration 属性一起使用。

语法

以下是<ins>标签的语法。

<ins>The text to be inserted</ins>

Example

的中文翻译为:

示例

以下是在 HTML 中标记插入文本的示例程序。

<!DOCTYPE html>
<html>
<head>
</head>
<body>
   <p>DLF stands for</p><ins>Delhi Land and Finance</ins>
   <p>Delhi Land and Finance is one of the largest commercial real estate developer in India.</p>
</body>
</html>

通过内联CSS标记插入的文本

使用 CSS 属性为文本添加下划线。此属性在

标记内使用。

语法

以下是使用CSS属性标记插入文本的语法。

<p style="text decoration:underline;">The content to be underlined</p>

Example

的中文翻译为:

示例

以下是使用 CSS 属性标记插入文本的示例程序。

<!DOCTYPE html>
<html>
<head>
</head>
<body>
   <p>DLF stands for</p><p style="text-decoration:underline;">Delhi Land and Finance. </p>
   <p> Delhi Land and Finance is one of the largest commercial real estate developer in India.</p>
</body>
</html>

Example

的中文翻译为:

示例

我们可以在 HTML 元素内使用 标签。以下是在 HTML 中标记插入和删除文本的示例程序。

<!DOCTYPE html>
<html>
<head>
</head>
<body>
   <p>DLF stands for Delhi Land and Finance.</p>
   <p>Company has changed its name from </p><del>DLF Universal Ltd</del> to<ins>DLF Ltd.</ins>
   <p>Delhi Land and Finance is one of the largest commercial real estate developer in India.</p>
</body>
</html>