📅  最后修改于: 2023-12-03 15:31:18.973000             🧑  作者: Mango
标签
标签用于引用其他人的话或其他来源的内容。在HTML中,标签是用于显示长段引用的最佳方式。语法
<blockquote> This is a blockquote. </blockquote>
属性
标签支持以下属性:
cite
:指定被引文本的来源URL。class
:为元素指定样式类。例子
基本例子
<blockquote> This is a blockquote. </blockquote>
输出:
This is a blockquote.添加标签
<blockquote> <p>People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily.</p> <footer><cite><a href="https://en.wikipedia.org/wiki/Zig_Ziglar">Zig Ziglar</a></cite></footer> </blockquote>
输出:
People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily.
指定样式类
<blockquote class="blue-border"> This is a blockquote. </blockquote> <style> .blue-border { border: 2px solid blue; padding: 10px; } </style>
输出:
This is a blockquote.结论
标签是HTML中用于引用其他人的话或其他来源内容的最佳方式。我们可以使用它来优雅地显示长段引用,并通过指定样式类来自定义它的外观。无论是用于网页设计还是文档排版,标签都是必不可少的HTML元素之一。