HTML Unit 1: Basics, styles, formatting and quotations Flashcards

1
Q

What is the correct HTML code to create a heading?

A

`<h1>This is a heading</h1>

<h2>This is a subheading</h2>

<h3>This is a smaller heading</h3>

<h4>This is an even smaller heading</h4>

<h5>This is a tiny heading</h5>

<h6>This is the smallest heading</h6>

`
<h1> is the largest heading, while <h6> is the smallest.
Headings help structure the content on a webpage for both users and search engines.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you create an HTML <h1> heading with a font size of 60px?

A

<h1 style="font-size:60px;">Heading 1</h1>
The style attribute is used for inline CSS to apply specific styling directly to the HTML element.
In this case, it changes the font size of the <h1> tag to 60px.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you insert a line break using HTML?

A

The <br> tag is used to insert a line break in text.
It is a self-closing tag, used to break content into a new line without starting a new paragraph.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the <hr> tag do in HTML?

A

The <hr> tag creates a horizontal rule or line, often used to separate content.
It is a self-closing tag and does not require a closing tag.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How is the <pre> tag used in HTML, and what does it do?

A

<pre> This is preformatted text. </pre>
The <pre> tag is used for preformatted text.
It preserves both spaces and line breaks, displaying the content exactly as written.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the purpose of the <p> tag in HTML?

A

<p>This is a paragraph.</p>
The <p> tag defines a paragraph of text.
Browsers automatically add some space before and after paragraphs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you use the style attribute in HTML to apply CSS to an element?

A

<p style="color:blue; font-size:20px;">This is a styled paragraph.</p>
The style attribute is used to apply inline CSS directly to an HTML element.
The format is style="property:value;".
In this example:
color:blue; changes the text color to blue.
font-size:20px; sets the font size to 20px.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the difference between inline, internal, and external CSS? Change the body’s background to powderblue.

A

Inline: <body style="background-color:powderblue;"> </body>

Internal: <style>body { background-color: powderblue;}</style>

External: <link rel="stylesheet" href="styles.css"> /* In styles.css */ body { background-color: powderblue; }

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How can you apply red text color to a paragraph using inline CSS?

A

<p style="color:red;">This is a paragraph.</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you apply the Courier font to a paragraph using inline CSS?

A

<p style="font-family:courier;">This is a paragraph.</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you increase the text size of a paragraph using inline CSS?

A

<p style="font-size:160%;">This is a paragraph.</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you center-align a paragraph using inline CSS?

A

<p style="text-align:center;">Centered paragraph.</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does the HTML <b> element do?

A

The <b> tag is used to create bold text.
It does not imply any extra importance or emphasis, just bold styling.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the purpose of the HTML <strong> element?

A

The <strong> tag is used to indicate text with strong importance. By default, the text inside is typically displayed in bold, but it also conveys semantic meaning, suggesting that the content has significant importance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does the HTML <i> element do, and when might it be used?

A

The <i> tag defines text in an alternate voice or mood, often displayed in italic.
Commonly used for:
Technical terms
Foreign phrases
Thoughts
Names of ships or other works

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the purpose of the HTML <em> element, and how does it affect text?

A

The <em> tag is used to define emphasized text, typically displayed in italic.
It also has semantic meaning, indicating that the text should be pronounced with verbal stress by screen readers, conveying additional emphasis.

17
Q

What does the HTML <small> element do?

A

<small>This is some smaller text.</small>
The <small> tag is used to define smaller text.
It reduces the font size of the text inside, typically used for fine print, disclaimers, or secondary information.

18
Q

What is the purpose of the HTML <mark> element?

A

<p>Do not forget to buy <mark>milk</mark> today.</p>
The <mark> tag is used to define text that should be marked or highlighted.
Typically used to highlight relevant text, making it stand out to the reader.

19
Q

What does the HTML <del> element indicate, and how is it typically displayed?

A

<p>My favorite color is <del>blue</del> red.</p>
The <del>tag is used to define text that has been deleted from a document.
Browsers typically display deleted text with a strikethrough line to show that it has been removed.

20
Q

What does the HTML <ins> element represent, and how is it typically displayed?

A

<p>My favorite color is <del>blue</del> <ins>red</ins>.</p>
The <ins> tag is used to define text that has been inserted into a document.
Browsers typically display inserted text with an underline to indicate that it has been added.

21
Q

What does the HTML <sub> element do, and where is it typically used?

A

<p>This is <sub>subscripted</sub> text.</p>
The <sub> tag defines subscript text, which appears half a character below the normal line and is often rendered in a smaller font.
Commonly used for chemical formulas, such as H₂O, or other mathematical notations.

22
Q

What does the HTML <sup> element represent, and where might it be used?

A

The <sup> tag defines superscript text, which appears half a character above the normal line and is often rendered in a smaller font.
Commonly used for footnotes, exponents, or mathematical notations, such as in WWW¹.

23
Q

What is the purpose of the HTML <blockquote> element, and how is it typically displayed?

A

`<p>Here is a quote from WWF’s website:</p>

<blockquote>
For 60 years, WWF has worked to help people and nature thrive.
</blockquote>

`

The <blockquote> tag defines a section that is quoted from another source.
Browsers usually indent <blockquote> elements to visually separate the quoted text from the rest of the content.
The cite attribute can provide a URL to the source of the quotation.

24
Q

What does the HTML <q> element do, and how is it typically displayed?

A

<p>WWF's goal is to: <q>Build a future where people live in harmony with nature.</q></p>
The <q> tag defines a short quotation.
Browsers usually insert quotation marks around the quoted text to indicate that it is a quotation.

25
Q

How is the HTML <abbr> element used, and how can it be enhanced with additional information?

A

<p>The <abbr title="World Health Organization">WHO</abbr> was founded in 1948.</p>
The <abbr> tag defines an abbreviation or acronym, such as “HTML”, “CSS”, “Mr.”, “Dr.”, “ASAP”, or “ATM”.
It can be enhanced with the title attribute to provide a description of the abbreviation.
Browsers, translation systems, and search engines can use this information for better understanding and functionality.
The title attribute will show the full form when you mouse over the abbreviation.

26
Q

What is the purpose of the HTML <address> element, and how is it typically formatted?

A

<address> Written by John Doe.<br> Visit us at:<br> Example.com<br> Box 564, Disneyland<br> USA </address>
The <address> tag defines contact information for the author or owner of a document or article.
It can include email addresses, URLs, physical addresses, phone numbers, or social media handles.
Text inside the <address> element usually renders in italic.
Browsers automatically add a line break before and after the <address> element to separate it from other content.

27
Q

What is the purpose of the HTML <cite> element, and how is it typically used?

A

<p><cite>The Scream</cite> by Edvard Munch. Painted in 1893.</p>
The <cite> tag is used to define the title of a creative work, such as a book, poem, song, movie, painting, or sculpture.
It is not used for a person’s name, which is not considered the title of a work.
Text within the <cite> element usually renders in italic to highlight the title of the work.

28
Q

What does the HTML <bdo> element do, and how is it used?

A

<bdo dir="rtl">This text will be written from right to left</bdo>
The <bdo> tag stands for Bi-Directional Override.
It is used to override the default text direction of an element.
The dir attribute specifies the text direction:
dir="ltr" for left-to-right text (default)
dir="rtl" for right-to-left text
In this example, the text will be written from right to left.

29
Q

What is the syntax for adding comments in HTML, and what is their purpose?

A

<!-- Write your comments here -->
HTML comments use the syntax <!-- comment -->.
Comments are not displayed by the browser but help document and organize your HTML source code.
They are useful for adding notes, reminders, and explanations within the code.

30
Q

How can HTML comments be used to hide content temporarily?

A

`<p>This is a paragraph.</p>

<!-- <p>This is another paragraph </p> -->

<p>This is a paragraph too.</p>

`
Comments can be used to hide parts of HTML code temporarily.
Everything between <!-- and --> is hidden from the display.
This can be useful for debugging or temporarily removing sections of code.

31
Q

How can you use HTML comments to hide parts of a paragraph or inline content?

A

<p>This <!-- great text --> is a paragraph.</p>
Comments can be used to hide parts of a paragraph or inline content.
Everything between <!-- and --> will not be displayed in the browser, allowing you to selectively hide content within a line of HTML code.