Thẻ HTML <blockquote>
Ví dụ
Một đoạn được trích dẫn từ một nguồn khác:
<blockquote cite="https://www.worldwildlife.org/who/index.html">
For 50 years, WWF has been protecting the future of nature. The world's leading conservation organization, WWF works in 100 countries and is supported by 1.2 million members in the United States and close to 5 million globally.
</blockquote>
Hãy tự mình thử »Thêm ví dụ "Hãy tự mình thử" bên dưới.
Định nghĩa và cách sử dụng
Thẻ <blockquote>
chỉ định một phần được trích dẫn từ nguồn khác.
Các trình duyệt thường thụt lề các phần tử <blockquote>
(xem ví dụ bên dưới để biết cách loại bỏ thụt lề).
Lời khuyên và ghi chú
Mẹo: Sử dụng <q>
cho các trích dẫn nội tuyến (ngắn).
Hỗ trợ trình duyệt
Element | |||||
---|---|---|---|---|---|
<blockquote> | Yes | Yes | Yes | Yes | Yes |
Thuộc tính
Attribute | Value | Description |
---|---|---|
cite | URL | Specifies the source of the quotation |
Thuộc tính chung
Thẻ <blockquote>
cũng hỗ trợ Thuộc tính chung trong HTML .
Thuộc tính sự kiện
Thẻ <blockquote>
cũng hỗ trợ Thuộc tính sự kiện trong HTML .
Thêm ví dụ
Ví dụ
Sử dụng CSS để xóa thụt lề khỏi phần tử blockquote:
<html>
<head>
<style>
blockquote {
margin-left: 0;
}
</style>
</head>
<body>
<p>Here is a quote from WWF's
website:</p>
<blockquote
cite="https://www.worldwildlife.org/who/index.html">
For 50 years, WWF has
been protecting the future of nature. The world's leading conservation
organization, WWF works in 100 countries and is supported by 1.2 million
members in the United States and close to 5 million globally.
</blockquote>
</body>
</html>
Hãy tự mình thử »Trang liên quan
Tham chiếu DOM HTML: Đối tượng Blockquote
Cài đặt CSS mặc định
Hầu hết các trình duyệt sẽ hiển thị phần tử <blockquote>
với các giá trị mặc định sau:
Ví dụ
blockquote {
display: block;
margin-top: 1em;
margin-bottom: 1em;
margin-left: 40px;
margin-right: 40px;
}
Hãy tự mình thử »