HTML q 标签

htmlweb developmentfront end technology更新于 2025/3/20 3:24:17

HTML 中的 q 标签用于指定简短的引用。引号会插入 q 标签内设置的文本(即引用部分)的两边。

以下是属性 −

  • cite:设置引用的源 URL。

现在让我们看一个实现 <q> 标签的示例 −

示例

<!DOCTYPE html>
<html>
<body>
<h2>Thoughts</h2>
   <p>Warren Buffett quoted,
   <q>It's better to hang out with people better than you. Pick out associates whose behavior is
   better than yours and you'll drift in that direction. </q></p>
   <p>Bill Gates quoted,
   <q>Your most unhappy customers are your greatest source of learning.</q></p>
</body>
</html>

输出

在上面的例子中,我们使用 HTML 中的 <q> 标签设置了一些引号 −

<p>Warren Buffett quoted,
<q>It's better to hang out with people better than you. Pick out associates whose behavior is better than yours and you'll drift in that direction. </q>

如上所示,我们使用 <q> 标签设置了引号。输出显示 <q> 标签会自动在引号周围添加一个简短的引文。


相关文章


有用资源