如何使用 HTML 添加引用自其他来源的段落?


引用 是一个文本元素,用于指示引用或被引用或引用的文本段落。在 HTML 中创建引用的主要方法有两种:“blockquote”标签和“q”标签。

使用 HTML 添加引用自其他来源的段落

要在 HTML 文档中添加引用自其他来源的段落,我们使用<blockquote>标签。<blockquote>标签用于指示包含的文本是来自其他来源的引用。

要在 HTML 文档中使用<blockquote>标签,只需将引用文本用<blockquote>和</blockquote>标签括起来。

例如

<blockquote>
   Text Content
</blockquote>

您还可以使用 cite 属性包含引用的来源。cite 属性指定引用的来源的 URL。

例如

<blockquote cite="https://tutorialspoint.com/articles/index.php">
      Text Content
</blockquote>

最好使用<footer>标签和<cite>标签在引用中包含作者和来源的标题。

例如

<blockquote cite="https://tutorialspoint.com/articles/index.php">
   Text Content
   <footer>Tutorials Point, <cite>India</cite></footer>
</blockquote>

通过在 HTML 文档中正确引用来源,您可以确保读者可以轻松验证您提供的信息准确性,并给予内容的原始作者应有的认可。此外,它还有助于避免剽窃,即未经授权使用他人的作品和想法而不予以署名。

示例

在下面的示例中,我们添加了一个 blockquote 部分。该部分是在没有<cite>和<footer>的情况下定义的。

Open Compiler
<html> <body> <h2>Welcome to TutorialsPoint</h2> <blockquote> Tutorials Point originated from the idea that there exists a class of readers who respond better to online content and prefer to learn new skills at their own pace from the comforts of their drawing rooms. </blockquote> </body> </html>

示例

在下面的示例中,我们添加了一个 blockquote 部分。该部分是用<cite>和<footer>定义的。

Open Compiler
<html> <body> <h2>Welcome to TutorialsPoint</h2> <blockquote cite="https://tutorialspoint.com/articles/index.php"> Tutorials Point originated from the idea that there exists a class of readers who respond better to online content and prefer to learn new skills at their own pace from the comforts of their drawing rooms. <footer>Tutorials Point, <cite>India</cite></footer> </blockquote> </body> </html>

我们可以通过定位 blockquote 元素并应用所需的样式来使用 CSS 样式化 blockquote。例如,要将文本颜色更改为蓝色,我们将以下代码添加到 CSS 文件中:

blockquote {
   color: blue;
}

示例

Open Compiler
<html> <head> <style> blockquote { color: blue; } </style> </head> <body> <h2>Welcome to Tutorials Point</h2> <blockquote cite="https://tutorialspoint.com/articles/index.php"> Tutorials Point originated from the idea that there exists a class of readers who respond better to online content and prefer to learn new skills at their own pace from the comforts of their drawing rooms. <footer>Tutorials Point, <cite>India</cite></footer></blockquote> </body> </html>

结论

当涉及到在 HTML 文档中引用来源时,<blockquote>标签是一个重要的工具。通过使用此标签,您可以正确指示哪些文本是引用,并为读者提供他们需要验证您提供的信息准确性的信息。通过使用 cite 属性、<footer>标签和<cite>标签,您可以提供更多关于引用来源的上下文和详细信息,使读者能够轻松找到并访问原始资料。

更新于: 2023-03-09

152 次浏览

开启您的 职业生涯

通过完成课程获得认证

开始学习
广告