如何在 HTML 中顯示短引用?


在 Html 中,為了在瀏覽器頁面中插入帶引號的文字,我們使用引用元素。與普通文字相比,引用的文字顯示效果不同。

<q> 元素是什麼?

此元素用於在 HTML 文件中的一組文字中插入引號。它具有開始和結束標籤。以下是 HTML 中<q> 元素的語法。

<q> text…… </q>

示例

以下是一個示例,我們嘗試在 HTML 中顯示一個短引用 -

<!DOCTYPE html>
<html>
<head>
   <title>Usage of Quotations</title>
	<style>
      h1{
         color: blue;
      }
      p{
         color: red;
      }
	</style>
</head>
<body>
   <h1>TutorialsPoint</h3>
   <h2>Tutorials Point is a leading Ed Tech company <br></h2>
   <p><q>Provides best learning material on technical and non-technical subjects.</q></p>
 </body>
</html>  

<blockquote> 元素

此元素用於縮排新段落的開頭,並且還在每個句子的開頭新增空格。它具有開始和結束標籤。以下是 blockquote 的語法 -

<blockquote> text……. </blockquote>

示例

在以下示例中,我們嘗試建立一個 blockquote。

<!DOCTYPE html>
<html>
<head>
   <title>Block Quotations</title>
   <style>
      h1 {
         color: blue;
      }

      blockquote {
         color: red;
      }
   </style>
</head>
<body>
   <h1>TutorialsPoint </h1>
   <h2> Tutorials Point is a leading Ed Tech company <br>
   </h2>
   <blockquote>Provides best learning material on technical and non-technical subjects. </blockquote>
</body>
</html>

<address> 元素

此元素用於在網頁中定義地址,出現在 address 標籤之間的文字以斜體格式顯示。這對使用者閱讀和區分很有用。

示例

以下是在 HTML 中使用<address> 標籤的示例 -

<!DOCTYPE html>
<html>
<head>
   <title>Address Quotations</title>
   <style>
      h1 {
         color: blue;
      }

      address {
         color: red;
      }
   </style>
</head>
<body>
   <h1>TutorialsPoint</h1>
   <h2> Tutorials Point is a leading Ed Tech company <br>
   </h2>
   <p>Address: <br>
   <address> Tutorials Point India Private Limited, 4th Floor Incor9 Building, Kavuri Hills, Madhapur, Hyderabad, Telangana - 500081, INDIA </p>
   </address>
</body>
</html>

<abbr> 元素

當您將滑鼠懸停在<abbr> 元素上時,此元素會顯示縮寫。它主要對搜尋引擎有用。以下是 HTML 中縮寫標籤的語法 -

<abbr> text….. </abbr>

示例

以下示例演示瞭如何在 HTML 中使用<abbreviation> 標籤 -

<!DOCTYPE html>
<html>
<head>
   <title>Abbreviation Quotations</title>
   <style>
      h1 {
         color: blue;
      }

      address {
         color: red;
      }
   </style>
</head>
<body>
   <h1>TutorialsPoint</h1>
   <h2> Tutorials Point is a leading Ed Tech company <br>
   </h2>
   <p>Hyper Text MarkUp Language in simple called as <br>
      <abbr title="Hyper Text Markup Language">HTML</abbr>
   </p>
</body>
</html>

更新於: 2023年10月10日

307 次瀏覽

開啟你的 職業生涯

透過完成課程獲得認證

開始學習
廣告

© . All rights reserved.