Thẻ HTML <blockquote>
Thí dụ
Một phần được trích dẫn từ một nguồn khác:
<blockquote cite="http://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>
Thêm các 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ừ một nguồn khác.
Trình duyệt thường thụt lề <blockquote>
các phần tử (xem ví dụ bên dưới để biết cách loại bỏ thụt lề).
Mẹo và lưu ý
Mẹo: Sử dụng <q>
cho các trích dẫn nội dòng (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 toàn cầu
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 .
Các ví dụ khác
Thí dụ
Sử dụng CSS để loại bỏ 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="http://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>
Các 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ị <blockquote>
phần tử với các giá trị mặc định sau:
Thí dụ
blockquote {
display: block;
margin-top: 1em;
margin-bottom: 1em;
margin-left: 40px;
margin-right: 40px;
}