如何在 HTML 中使用 blockquote?


<blockquote> 標籤用於標示長引文。它應當只包含塊級元素,而不僅僅是普通文字。它指定從其他來源引用的部分,並且只包含塊級元素。

我們還可以在 <blockquote> 標籤內使用 cite 屬性以 URL 形式指示引文來源。

語法

以下是 <blockquote> 標籤的語法。

<blockquote>The multiple line content to be quoted </blockquote>

示例

以下是 <blockquote> 標籤的示例程式。

<!DOCTYPE html> <html> <head> </head> <body> <p>DLF stands for Delhi Land and Finance</p> <blockquote>Delhi Land and Finance is one of the largest commercial real estate developer in India.It is also engaged in the business of generation of power provision of maintenance services hospitality and recreational activities life insurance and retail chain outlets. Its internalbusiness includes development business and rental business. The development business of the Company is involved in the sale of residential spaces select commercial offices and commercial complexes. The company has a unique business model with earnings arising from development and rentals.</blockquote> </body> </html>

示例

以下是當我們在 <blockquote> 標籤內使用 cite 屬性時的示例程式。

<!DOCTYPE html> <html> <head> <title>HTML blockquote tag</title> </head> <body> <h1>Drupal</h1> <p>Here is a quotation from Drupal’s official website</p> <blockquote cite="http://drupal.org">The Drupal project is open source software. Anyone can download, use, work on, and share it with others. It's built on principles like collaboration, globalism, and innovation.</blockquote> </body> </html>

示例

以下是當我們使用 CSS 更改 <blockquote> 標籤的樣式時的示例程式。

<!DOCTYPE html> <html> <head> <title>HTML blockquote tag</title> <style> blockquote { margin-left: 0; } </style> </head> <body> <h1>Drupal</h1> <p>Here is a quotation from Drupal’s official website</p> <blockquote cite="http://drupal.org">The Drupal project is open source software. Anyone can download, use, work on, and share it with others. It's built on principles like collaboration, globalism, and innovation.</blockquote> </body> </html>

更新時間:11-Nov-2022

543 次瀏覽

開啟你的職業生涯

完成課程以獲得認證

開始
廣告