10. Quotations and Code Snippets
HTML provides specific tags for citing sources and displaying code.
10.1 Blockquotes (<blockquote>)
Used for quoting large sections of text from another source. It is a block-level element.
It is best practice to include the cite attribute, which points to the source URL (though this URL is not visible on the page).
html
HTML is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as CSS and scripting languages such as JavaScript.
— The definition, according to Wikipedia.
10.2 Inline Quotations (<q>)
Used for shorter, inline quotes, typically within a sentence.
html
She whispered, I need to learn HTML right away.
and started searching for courses.
10.3 Displaying Code
<code>: Used to mark up a short fragment of computer code (inline).<pre>: Used to wrap a block of preformatted text, preserving spaces and line breaks exactly as typed. Often used in conjunction with<code>for multi-line code blocks.
html
The main function is called using document.getElementById('id').
function calculateArea(r) {
return Math.PI * r * r;
}