HTML5 Flashcards

1
Q
A

declaration defines that this document is an HTML5 document

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

declaration defines that this document is an HTML5 document

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

element is the root element of an HTML page

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

element contains meta information about the HTML page

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

element specifies a title for the HTML page (which is shown in the browser’s title bar or in the page’s tab)

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

element defines the document’s body, and is a container for all the visible contents, such as headings, paragraphs, images, hyperlinks, tables, lists, etc.

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

<h1></h1>

A

element defines a large heading, can have up to 6, h1, h2, h3, etc each gets smaller, it’s good practice to only use one h1

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

<p></p>

A

element defines a paragraph

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

What is an HTML Element?

A

An HTML element is defined by a start tag, some content, and an end tag:
Content goes here…
The HTML element is everything from the start tag to the end tag:

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

Web Browsers

A

The purpose of a web browser (Chrome, Edge, Firefox, Safari) is to read HTML documents and display them correctly.

A browser does not display the HTML tags, but uses them to determine how to display the document:

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

<a></a>

A

HTML links are defined with the <a> tag:</a>

Example
</a><a>This is a link</a>

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

<img></img>

A

HTML images are defined with the <img></img> tag.

The source file (src), alternative text (alt), width, and height are provided as attributes:

Example
<img></img>

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

<br></br>

A

The <br></br> tag defines a line break, and is an empty element without a closing tag:

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

HTML is Not Case Sensitive

A

HTML tags are not case sensitive: <p> means the same as </p><p>.

The HTML standard does not require lowercase tags, but W3C recommends lowercase in HTML, and demands lowercase for stricter document types like XHTML.</p>

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

HTML Attributes

A

All HTML elements can have attributes
Attributes provide additional information about elements
Attributes are always specified in the start tag
Attributes usually come in name/value pairs like: name=”value”

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

The href Attribute

A

The <a> tag defines a hyperlink. The href attribute specifies the URL of the page the link goes to:</a>

Example
</a><a>Visit W3Schools</a>

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

The src Attribute

A

The <img></img> tag is used to embed an image in an HTML page. The src attribute specifies the path to the image to be displayed:

Example
<img></img>
There are two ways to specify the URL in the src attribute:
1. Absolute URL - Links to an external image that is hosted on another website. Example: src=”https://www.w3schools.com/images/img_girl.jpg”.2.

Relative URL - Links to an image that is hosted within the website. Here, the URL does not include the domain name. If the URL begins without a slash, it will be relative to the current page. Example: src=”img_girl.jpg”. If the URL begins with a slash, it will be relative to the domain. Example: src=”/images/img_girl.jpg”.

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

The width and height Attributes for images

A

The <img></img> tag should also contain the width and height attributes, which specifies the width and height of the image (in pixels):

Example
<img></img>

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

The alt Attribute

A

The required alt attribute for the <img></img> tag specifies an alternate text for an image, if the image for some reason cannot be displayed. This can be due to slow connection, or an error in the src attribute, or if the user uses a screen reader.

Example
<img></img>

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

The style Attribute

A

The style attribute is used to add styles to an element, such as color, font, size, and more.

Example

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

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

The lang Attribute

A

You should always include the lang attribute inside the tag, to declare the language of the Web page. This is meant to assist search engines and browsers.

The following example specifies English as the language:

Country codes can also be added to the language code in the lang attribute. So, the first two characters define the language of the HTML page, and the last two characters define the country.

The following example specifies English as the language and United States as the country:

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

The title Attribute

A

The title attribute defines some extra information about an element.

The value of the title attribute will be displayed as a tooltip when you mouse over the element:

Example

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

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

Single or Double Quotes?

A

Double quotes around attribute values are the most common in HTML, but single quotes can also be used.

In some situations, when the attribute value itself contains double quotes, it is necessary to use single quotes:

<p>
Or vice versa:

</p>

<p></p>

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

Bigger Headings

A

Each HTML heading has a default size. However, you can specify the size for any heading with the style attribute, using the CSS font-size property:

Example

<h1>Heading 1</h1>

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

HTML Horizontal Rules

A

The <hr> tag defines a thematic break in an HTML page, and is most often displayed as a horizontal rule.

The <hr> element is used to separate content (or define a change) in an HTML page:

Example
<h1>This is heading 1</h1>
<p>This is some text.</p>
<hr>
<h2>This is heading 2</h2>
<p>This is some other text.</p>
<hr>

The <hr> tag is an empty tag, which means that it has no end tag.

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

HTML Line Breaks

A

The HTML <br></br> element defines a line break.

Use <br></br> if you want a line break (a new line) without starting a new paragraph:

Example

<p>This is<br></br>a paragraph<br></br>with line breaks.</p>

The <br></br> tag is an empty tag, which means that it has no end tag.

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

The Poem Problem
This poem will display on a single line:

Example

<p>
My Bonnie lies over the ocean.

My Bonnie lies over the sea.

My Bonnie lies over the ocean.

Oh, bring back my Bonnie to me.
</p>

A

Solution - The HTML <pre> Element
The HTML <pre> element defines preformatted text.

The text inside a <pre> element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks:

Example

<pre>
My Bonnie lies over the ocean.

My Bonnie lies over the sea.

My Bonnie lies over the ocean.

Oh, bring back my Bonnie to me.
</pre>

</pre></pre></pre>

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

HTML Styles

A

The HTML style attribute is used to add styles to an element, such as color, font, size, and more.

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

The HTML Style Attribute

A

Setting the style of an HTML element, can be done with the style attribute.

The HTML style attribute has the following syntax:

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

Background Color

A

The CSS background-color property defines the background color for an HTML element
Example
Set the background color for a page to powderblue:

<h1>This is a heading</h1>

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

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

Text Color

A

The CSS color property defines the text color for an HTML element:

Example

<h1>This is a heading</h1>

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

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

Fonts

A

The CSS font-family property defines the font to be used for an HTML element:

Example

<h1>This is a heading</h1>

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

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

Text Size

A

The CSS font-size property defines the text size for an HTML element:

Example

<h1>This is a heading</h1>

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

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

Text Alignment

A

The CSS text-align property defines the horizontal text alignment for an HTML element:

Example

<h1>Centered Heading</h1>

<p>Centered paragraph.</p>

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

HTML Formatting Elements

A

Formatting elements were designed to display special types of text:

<b> - Bold text
<strong> - Important text
<i> - Italic text
<em> - Emphasized text
 - Marked text
<small> - Smaller text
<del> - Deleted text
<ins> - Inserted text
<sub> - Subscript text
<sup> - Superscript text</sup></sub></ins></del></small></em></i></strong></b>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

HTML <b> and <strong> Elements</strong></b>

A

The HTML <strong> element defines text with strong importance. The content inside is typically displayed in bold.</strong>

</strong>

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

HTML <i> and <em> Elements</em></i>

A

The HTML <em> element defines emphasized text. The content inside is typically displayed in italic.</em>

</em>

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

HTML <small> Element</small>

A

The HTML <small> element defines smaller text:</small>

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

HTML Element

A

The HTML element defines text that should be marked or highlighted:

Example

<p>Do not forget to buy milk today.</p>

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

HTML <del> Element</del>

A

The HTML <del> element defines text that has been deleted from a document. Browsers will usually strike a line through deleted text:</del>

Example

<p>My favorite color is <del>blue</del> red.</p>

</del>

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

HTML <ins> Element</ins>

A

The HTML <ins> element defines a text that has been inserted into a document. Browsers will usually underline inserted text:</ins>

Example

<p>My favorite color is <del>blue</del> <ins>red</ins>.</p>

</ins>

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

HTML Element

A

The HTML element defines subscript text. Subscript text appears half a character below the normal line, and is sometimes rendered in a smaller font. Subscript text can be used for chemical formulas, like H2O:

Example

<p>This is subscripted text.</p>

</sub>

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

HTML Element

</sup>

A

The HTML element defines superscript text. Superscript text appears half a character above the normal line, and is sometimes rendered in a smaller font. Superscript text can be used for footnotes, like WWW[1]:

Example

<p>This is superscripted text.</p>

</sup>

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

HTML <blockquote> for Quotations</blockquote>

A

The HTML <blockquote> element defines a section that is quoted from another source.

Browsers usually indent <blockquote> elements.

Example

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

<blockquote>
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>

</blockquote></blockquote>

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

HTML for Short Quotations

A

The HTML tag defines a short quotation.

Browsers normally insert quotation marks around the quotation.

Example

<p>WWF's goal is to: Build a future where people live in harmony with nature.</p>

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

HTML <abbr> for Abbreviations</abbr>

A

The HTML <abbr> tag defines an abbreviation or an acronym, like “HTML”, “CSS”, “Mr.”, “Dr.”, “ASAP”, “ATM”.</abbr>

Marking abbreviations can give useful information to browsers, translation systems and search-engines.

Tip: Use the global title attribute to show the description for the abbreviation/acronym when you mouse over the element.

Example

<p>The <abbr>WHO</abbr> was founded in 1948.</p>

</abbr>

47
Q

HTML <address> for Contact Information

</address>

A

The HTML <address> tag defines the contact information for the author/owner of a document or an article.

The contact information can be an email address, URL, physical address, phone number, social media handle, etc.

The text in the <address> element usually renders in italic, and browsers will always add a line break before and after the <address> element.

Example
<address>
Written by John Doe.<br>
Visit us at:<br>
Example.com<br>
Box 564, Disneyland<br>
USA
</address></address></address></address>
48
Q

HTML <cite> for Work Title</cite>

A

The HTML <cite> tag defines the title of a creative work (e.g. a book, a poem, a song, a movie, a painting, a sculpture, etc.).</cite>

Note: A person’s name is not the title of a work.

The text in the <cite> element usually renders in italic.</cite>

Example

<p><cite>The Scream</cite> by Edvard Munch. Painted in 1893.</p>

</cite></cite>

49
Q

HTML for Bi-Directional Override

A

BDO stands for Bi-Directional Override.

The HTML tag is used to override the current text direction:

Example
This text will be written from right to left

50
Q

HTML Comment Tags

A

You can add comments to your HTML source by using the following syntax:

51
Q

Text Color

A

Example

<h1>Hello World</h1>

<p>Lorem ipsum...</p>

<p>Ut wisi enim...</p>

52
Q

Border Color

A

Example

<h1>Hello World</h1>

<h1>Hello World</h1>

<h1>Hello World</h1>

53
Q

Color Values

A

In HTML, colors can also be specified using RGB values, HEX values, HSL values, RGBA values, and HSLA values.

The following three <div> elements have their background color set with RGB, HEX, and HSL values:

<h1>...</h1>

<h1>...</h1>

<h1>...</h1>

The following two <div> elements have their background color set with RGBA and HSLA values, which adds an Alpha channel to the color (here we have 50% transparency):

<h1>...</h1>

<h1>...</h1>

</div></div>

54
Q

HTML Styles - CSS

A

What is CSS?
Cascading Style Sheets (CSS) is used to format the layout of a webpage.

With CSS, you can control the color, font, the size of text, the spacing between elements, how elements are positioned and laid out, what background images or background colors are to be used, different displays for different devices and screen sizes, and much more!

55
Q

Using CSS

A

CSS can be added to HTML documents in 3 ways:

Inline - by using the style attribute inside HTML elements
Internal - by using a element in the <head> section
External - by using a <link></link> element to link to an external CSS file
The most common way to add CSS, is to keep the styles in external CSS files. However, in this tutorial we will use inline and internal styles, because this is easier to demonstrate, and easier for you to try it yourself.

56
Q

Inline CSS

A

An inline CSS is used to apply a unique style to a single HTML element.

An inline CSS uses the style attribute of an HTML element.

The following example sets the text color of the <h1> element to blue, and the text color of the </h1><p> element to red:

Example
</p><h1 style="color:blue;">A Blue Heading</h1>

<p>A red paragraph.</p>

57
Q

Internal CSS

A

An internal CSS is used to define a style for a single HTML page.

An internal CSS is defined in the section of an HTML page, within a element.

The following example sets the text color of ALL the <h1> elements (on that page) to blue, and the text color of ALL the <p> elements to red. In addition, the page will be displayed with a “powderblue” background color:

Example
<!DOCTYPE html>
<html>
<head>
<style>
body {background-color: powderblue;}
h1   {color: blue;}
p    {color: red;}

<h1>This is a heading</h1>

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

58
Q

External CSS

A

An external style sheet is used to define the style for many HTML pages.

To use an external style sheet, add a link to it in the section of each HTML page:

Example

<h1>This is a heading</h1>

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

59
Q
A

element is the root element of an HTML page

60
Q
A

element contains meta information about the HTML page

61
Q
A

element specifies a title for the HTML page (which is shown in the browser’s title bar or in the page’s tab)

62
Q
A

element defines the document’s body, and is a container for all the visible contents, such as headings, paragraphs, images, hyperlinks, tables, lists, etc.

63
Q

<h1></h1>

A

element defines a large heading, can have up to 6, h1, h2, h3, etc each gets smaller, it’s good practice to only use one h1

64
Q

<p></p>

A

element defines a paragraph

65
Q

What is an HTML Element?

A

An HTML element is defined by a start tag, some content, and an end tag:
Content goes here…
The HTML element is everything from the start tag to the end tag:

66
Q

Web Browsers

A

The purpose of a web browser (Chrome, Edge, Firefox, Safari) is to read HTML documents and display them correctly.

A browser does not display the HTML tags, but uses them to determine how to display the document:

67
Q

<a></a>

A

HTML links are defined with the <a> tag:</a>

Example
</a><a>This is a link</a>

68
Q

<img></img>

A

HTML images are defined with the <img></img> tag.

The source file (src), alternative text (alt), width, and height are provided as attributes:

Example
<img></img>

69
Q

<br></br>

A

The <br></br> tag defines a line break, and is an empty element without a closing tag:

70
Q

HTML is Not Case Sensitive

A

HTML tags are not case sensitive: <p> means the same as </p><p>.

The HTML standard does not require lowercase tags, but W3C recommends lowercase in HTML, and demands lowercase for stricter document types like XHTML.</p>

71
Q

HTML Attributes

A

All HTML elements can have attributes
Attributes provide additional information about elements
Attributes are always specified in the start tag
Attributes usually come in name/value pairs like: name=”value”

72
Q

The href Attribute

A

The <a> tag defines a hyperlink. The href attribute specifies the URL of the page the link goes to:</a>

Example
</a><a>Visit W3Schools</a>

73
Q

The src Attribute

A

The <img></img> tag is used to embed an image in an HTML page. The src attribute specifies the path to the image to be displayed:

Example
<img></img>
There are two ways to specify the URL in the src attribute:
1. Absolute URL - Links to an external image that is hosted on another website. Example: src=”https://www.w3schools.com/images/img_girl.jpg”.2.

Relative URL - Links to an image that is hosted within the website. Here, the URL does not include the domain name. If the URL begins without a slash, it will be relative to the current page. Example: src=”img_girl.jpg”. If the URL begins with a slash, it will be relative to the domain. Example: src=”/images/img_girl.jpg”.

74
Q

The width and height Attributes for images

A

The <img></img> tag should also contain the width and height attributes, which specifies the width and height of the image (in pixels):

Example
<img></img>

75
Q

The alt Attribute

A

The required alt attribute for the <img></img> tag specifies an alternate text for an image, if the image for some reason cannot be displayed. This can be due to slow connection, or an error in the src attribute, or if the user uses a screen reader.

Example
<img></img>

76
Q

The style Attribute

A

The style attribute is used to add styles to an element, such as color, font, size, and more.

Example

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

77
Q

The lang Attribute

A

You should always include the lang attribute inside the tag, to declare the language of the Web page. This is meant to assist search engines and browsers.

The following example specifies English as the language:

Country codes can also be added to the language code in the lang attribute. So, the first two characters define the language of the HTML page, and the last two characters define the country.

The following example specifies English as the language and United States as the country:

78
Q

The title Attribute

A

The title attribute defines some extra information about an element.

The value of the title attribute will be displayed as a tooltip when you mouse over the element:

Example

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

79
Q

Single or Double Quotes?

A

Double quotes around attribute values are the most common in HTML, but single quotes can also be used.

In some situations, when the attribute value itself contains double quotes, it is necessary to use single quotes:

<p>
Or vice versa:

</p>

<p></p>

80
Q

Bigger Headings

A

Each HTML heading has a default size. However, you can specify the size for any heading with the style attribute, using the CSS font-size property:

Example

<h1>Heading 1</h1>

81
Q

HTML Horizontal Rules

A

The <hr> tag defines a thematic break in an HTML page, and is most often displayed as a horizontal rule.

The <hr> element is used to separate content (or define a change) in an HTML page:

Example
<h1>This is heading 1</h1>
<p>This is some text.</p>
<hr>
<h2>This is heading 2</h2>
<p>This is some other text.</p>
<hr>

The <hr> tag is an empty tag, which means that it has no end tag.

82
Q

HTML Line Breaks

A

The HTML <br></br> element defines a line break.

Use <br></br> if you want a line break (a new line) without starting a new paragraph:

Example

<p>This is<br></br>a paragraph<br></br>with line breaks.</p>

The <br></br> tag is an empty tag, which means that it has no end tag.

83
Q

The Poem Problem
This poem will display on a single line:

Example

<p>
My Bonnie lies over the ocean.

My Bonnie lies over the sea.

My Bonnie lies over the ocean.

Oh, bring back my Bonnie to me.
</p>

A

Solution - The HTML <pre> Element
The HTML <pre> element defines preformatted text.

The text inside a <pre> element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks:

Example

<pre>
My Bonnie lies over the ocean.

My Bonnie lies over the sea.

My Bonnie lies over the ocean.

Oh, bring back my Bonnie to me.
</pre>

</pre></pre></pre>

84
Q

HTML Styles

A

The HTML style attribute is used to add styles to an element, such as color, font, size, and more.

85
Q

The HTML Style Attribute

A

Setting the style of an HTML element, can be done with the style attribute.

The HTML style attribute has the following syntax:

86
Q

Background Color

A

The CSS background-color property defines the background color for an HTML element
Example
Set the background color for a page to powderblue:

<h1>This is a heading</h1>

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

87
Q

Text Color

A

The CSS color property defines the text color for an HTML element:

Example

<h1>This is a heading</h1>

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

88
Q

Fonts

A

The CSS font-family property defines the font to be used for an HTML element:

Example

<h1>This is a heading</h1>

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

89
Q

Text Size

A

The CSS font-size property defines the text size for an HTML element:

Example

<h1>This is a heading</h1>

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

90
Q

Text Alignment

A

The CSS text-align property defines the horizontal text alignment for an HTML element:

Example

<h1>Centered Heading</h1>

<p>Centered paragraph.</p>

91
Q

HTML Formatting Elements

A

Formatting elements were designed to display special types of text:

<b> - Bold text
<strong> - Important text
<i> - Italic text
<em> - Emphasized text
 - Marked text
<small> - Smaller text
<del> - Deleted text
<ins> - Inserted text
<sub> - Subscript text
<sup> - Superscript text</sup></sub></ins></del></small></em></i></strong></b>
92
Q

HTML <b> and <strong> Elements</strong></b>

A

The HTML <strong> element defines text with strong importance. The content inside is typically displayed in bold.</strong>

</strong>

93
Q

HTML <i> and <em> Elements</em></i>

A

The HTML <em> element defines emphasized text. The content inside is typically displayed in italic.</em>

</em>

94
Q

HTML <small> Element</small>

A

The HTML <small> element defines smaller text:</small>

95
Q

HTML Element

A

The HTML element defines text that should be marked or highlighted:

Example

<p>Do not forget to buy milk today.</p>

96
Q

HTML <del> Element</del>

A

The HTML <del> element defines text that has been deleted from a document. Browsers will usually strike a line through deleted text:</del>

Example

<p>My favorite color is <del>blue</del> red.</p>

</del>

97
Q

HTML <ins> Element</ins>

A

The HTML <ins> element defines a text that has been inserted into a document. Browsers will usually underline inserted text:</ins>

Example

<p>My favorite color is <del>blue</del> <ins>red</ins>.</p>

</ins>

98
Q

HTML Element

A

The HTML element defines subscript text. Subscript text appears half a character below the normal line, and is sometimes rendered in a smaller font. Subscript text can be used for chemical formulas, like H2O:

Example

<p>This is subscripted text.</p>

</sub>

99
Q

HTML Element

</sup>

A

The HTML element defines superscript text. Superscript text appears half a character above the normal line, and is sometimes rendered in a smaller font. Superscript text can be used for footnotes, like WWW[1]:

Example

<p>This is superscripted text.</p>

</sup>

100
Q

HTML <blockquote> for Quotations</blockquote>

A

The HTML <blockquote> element defines a section that is quoted from another source.

Browsers usually indent <blockquote> elements.

Example

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

<blockquote>
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>

</blockquote></blockquote>

101
Q

HTML for Short Quotations

A

The HTML tag defines a short quotation.

Browsers normally insert quotation marks around the quotation.

Example

<p>WWF's goal is to: Build a future where people live in harmony with nature.</p>

102
Q

HTML <abbr> for Abbreviations</abbr>

A

The HTML <abbr> tag defines an abbreviation or an acronym, like “HTML”, “CSS”, “Mr.”, “Dr.”, “ASAP”, “ATM”.</abbr>

Marking abbreviations can give useful information to browsers, translation systems and search-engines.

Tip: Use the global title attribute to show the description for the abbreviation/acronym when you mouse over the element.

Example

<p>The <abbr>WHO</abbr> was founded in 1948.</p>

</abbr>

103
Q

HTML <address> for Contact Information

</address>

A

The HTML <address> tag defines the contact information for the author/owner of a document or an article.

The contact information can be an email address, URL, physical address, phone number, social media handle, etc.

The text in the <address> element usually renders in italic, and browsers will always add a line break before and after the <address> element.

Example
<address>
Written by John Doe.<br>
Visit us at:<br>
Example.com<br>
Box 564, Disneyland<br>
USA
</address></address></address></address>
104
Q

HTML <cite> for Work Title</cite>

A

The HTML <cite> tag defines the title of a creative work (e.g. a book, a poem, a song, a movie, a painting, a sculpture, etc.).</cite>

Note: A person’s name is not the title of a work.

The text in the <cite> element usually renders in italic.</cite>

Example

<p><cite>The Scream</cite> by Edvard Munch. Painted in 1893.</p>

</cite></cite>

105
Q

HTML for Bi-Directional Override

A

BDO stands for Bi-Directional Override.

The HTML tag is used to override the current text direction:

Example
This text will be written from right to left

106
Q

HTML Comment Tags

A

You can add comments to your HTML source by using the following syntax:

107
Q

Text Color

A

Example

<h1>Hello World</h1>

<p>Lorem ipsum...</p>

<p>Ut wisi enim...</p>

108
Q

Border Color

A

Example

<h1>Hello World</h1>

<h1>Hello World</h1>

<h1>Hello World</h1>

109
Q

Color Values

A

In HTML, colors can also be specified using RGB values, HEX values, HSL values, RGBA values, and HSLA values.

The following three <div> elements have their background color set with RGB, HEX, and HSL values:

<h1>...</h1>

<h1>...</h1>

<h1>...</h1>

The following two <div> elements have their background color set with RGBA and HSLA values, which adds an Alpha channel to the color (here we have 50% transparency):

<h1>...</h1>

<h1>...</h1>

</div></div>

110
Q

HTML Styles - CSS

A

What is CSS?
Cascading Style Sheets (CSS) is used to format the layout of a webpage.

With CSS, you can control the color, font, the size of text, the spacing between elements, how elements are positioned and laid out, what background images or background colors are to be used, different displays for different devices and screen sizes, and much more!

111
Q

Using CSS

A

CSS can be added to HTML documents in 3 ways:

Inline - by using the style attribute inside HTML elements
Internal - by using a element in the <head> section
External - by using a <link></link> element to link to an external CSS file
The most common way to add CSS, is to keep the styles in external CSS files. However, in this tutorial we will use inline and internal styles, because this is easier to demonstrate, and easier for you to try it yourself.

112
Q

Inline CSS

A

An inline CSS is used to apply a unique style to a single HTML element.

An inline CSS uses the style attribute of an HTML element.

The following example sets the text color of the <h1> element to blue, and the text color of the </h1><p> element to red:

Example
</p><h1 style="color:blue;">A Blue Heading</h1>

<p>A red paragraph.</p>

113
Q

Internal CSS

A

An internal CSS is used to define a style for a single HTML page.

An internal CSS is defined in the section of an HTML page, within a element.

The following example sets the text color of ALL the <h1> elements (on that page) to blue, and the text color of ALL the <p> elements to red. In addition, the page will be displayed with a “powderblue” background color:

Example
<!DOCTYPE html>
<html>
<head>
<style>
body {background-color: powderblue;}
h1   {color: blue;}
p    {color: red;}

<h1>This is a heading</h1>

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

114
Q

External CSS

A

An external style sheet is used to define the style for many HTML pages.

To use an external style sheet, add a link to it in the section of each HTML page:

Example

<h1>This is a heading</h1>

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