如何使用 HTML 新增引用自其他來源的段落?
引用 是一個文字元素,用於指示引用或被引用或引用的文字段落。在 HTML 中建立引用的主要方法有兩種:“blockquote”標籤和“q”標籤。
使用 HTML 新增引用自其他來源的段落
要在 HTML 文件中新增引用自其他來源的段落,我們使用<blockquote>標籤。<blockquote>標籤用於指示包含的文字是來自其他來源的引用。
要在 HTML 文件中使用<blockquote>標籤,只需將引用文字用<blockquote>和</blockquote>標籤括起來。
例如 −
<blockquote> Text Content </blockquote>
您還可以使用 cite 屬性包含引用的來源。cite 屬性指定引用的來源的 URL。
例如 −
<blockquote cite="https://tutorialspoint.tw/articles/index.php"> Text Content </blockquote>
最好使用<footer>標籤和<cite>標籤在引用中包含作者和來源的標題。
例如 −
<blockquote cite="https://tutorialspoint.tw/articles/index.php"> Text Content <footer>Tutorials Point, <cite>India</cite></footer> </blockquote>
透過在 HTML 文件中正確引用來源,您可以確保讀者可以輕鬆驗證您提供的資訊準確性,並給予內容的原始作者應有的認可。此外,它還有助於避免剽竊,即未經授權使用他人的作品和想法而不予以署名。
示例
在下面的示例中,我們添加了一個 blockquote 部分。該部分是在沒有<cite>和<footer>的情況下定義的。
<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>定義的。
<html> <body> <h2>Welcome to TutorialsPoint</h2> <blockquote cite="https://tutorialspoint.tw/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; }
示例
<html> <head> <style> blockquote { color: blue; } </style> </head> <body> <h2>Welcome to Tutorials Point</h2> <blockquote cite="https://tutorialspoint.tw/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>標籤,您可以提供更多關於引用來源的上下文和詳細資訊,使讀者能夠輕鬆找到並訪問原始資料。