HTML Review Flashcards

1
Q

What are HTML Elements?

A

Elements are the building blocks for an HTML document. They represent headings, paragraphs, links, images and more. Most HTML elements consist of an opening tag (<elementName>) and a closing tag (</elementName>).

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

What are void elements?

A

Void elements cannot have any content and only have a start tag. Examples include img and meta elements.

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

What are attributes?

A

An attribute is a value placed inside the opening tag of an HTML element. Attributes provide additional information about the element or specify how the element should behave. Here is the basic syntax for an attribute:

<element></element>

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

What are comments?

A

Comments are used in programming to leave notes for yourself and other developers in your code. Here is the syntax for a comment in HTML:

<!--This is an HTML comment.-->

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

What is a boolean attribute?

A

A boolean attribute is an attribute that can either be present or absent in an HTML tag. If present, the value is true otherwise it is false. Examples of boolean attributes include disabled, readonly, and required.

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

What are headings?

A

There are six heading elements in HTML. The h1 through h6 heading elements are used to signify the importance of content below them. The lower the number, the higher the importance, so h2 elements have less importance than h1 elements.

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

Symbol for paragraph element

A

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

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

IMG Elements

A

The img element is used to add images to the web page. The src attribute is used to specify the location for that image. For image elements, it’s good practice to include another attribute called the alt attribute. Here’s an example of an img element with the src and alt attributes:
<img src=”https://cdn.freecodecamp.org/curriculum/cat-photo-app/lasagna

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

Body elements

A

This element is used to represent the content for the HTML document.

<body>
<h1>CatPhotoApp</h1>
<p>This is a paragraph element.</p>
</body>

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

Section elements

A

This element is used to divide up content into smaller sections.

<section>
<h2>About Me</h2>
<p>Hi, I am Jane Doe and I am a web developer.</p>
</section>

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

DIV elements

A

This element is a generic HTML element that does not hold any semantic meaning. It is used as a generic container to hold other HTML elements.

<div>
<h1>I am a heading</h1>
<p>I am a paragraph</p>
</div>

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

Anchor Elements

A

These elements are used to apply links to a web page. The href attribute is used to specify where the link should go when the user clicks on it.
<a href=”https://cdn.freecodecamp.org/curriculum/cat-photo-app/running-cats.

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

Unordered and Ordered Lists

A

Unordered <ul> Ordered <ol>

<ul>
<li>catnip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>

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

Emphasis Element

A

<em> italics </em>

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

Bold Element

A

<strong> Content </strong>

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

figure and figcaption Elements:

A

The figure element is used to group content like images and diagrams. The figcaption element is used to represent a caption for that content inside the figure element.

<figure>
<img></img>
<figcaption>Cats <strong>hate</strong> other cats.</figcaption>
</figure>

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

main Element:

A

This element is used to represent the main content for a web page.

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

footer Element:

A

This element is placed at the bottom of the HTML document and usually contains copyright information and other important page links.

<footer>
<p>
No Copyright - <a>freeCodeCamp.org</a>
</p>
</footer>

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

IDs

A

Unique element identifiers for HTML elements. ID names should only be used once per HTML document.

<h1>Movie Review Page</h1>

ID names cannot have spaces. If your ID name contains multiple words then you can use dashes between the words like this:

<div></div>

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

Classes

A

Classes are used to group elements for styling and behavior.

<div></div>

Unlike IDs, you can reuse the same class name throughout the HTML document. The class value can also have spaces like this:

<div></div>

<div></div>

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

HTML Entities

A

An HTML entity, or character reference, is a set of characters used to represent a reserved character in HTML. Examples include the ampersand (&) symbol and the less than symbol (<).

<p>This is an &lt;img /&gt; element</p>

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

Link element

A

This element is used to link to external resources like stylesheets and site icons. Here is the basic syntax for using the link element for an external CSS file:

<link></link>

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

Script element

A

This element is used to embed executable code.

<body>

<script>
alert("Welcome to freeCodeCamp");
</script>

</body>

While you can technically write all of your JavaScript code inside the script tags, it is considered best practice to link to an external JavaScript file instead. Here is an example of using the script element to link to an external JavaScript file:


24
Q

HTML Boilerplate

A

This is a boilerplate that includes the basic structure and essential elements every HTML document needs.
<!DOCTYPE html>

<html>
<head>
<meta></meta>
<title>freeCodeCamp</title>
<link></link>
</head>
<body>
<!--Headings, paragraphs, images, etc. go inside here-->
</body>
</html>

25
SEO
Search Engine Optimization is a practice that optimizes web pages so they become more visible and rank higher on search engines.
26
Meta (Description) element
This is used to provide a short description for the web page and impacting SEO.
27
Open Graph Tags
The open graph protocol enables you to control how your website's content appears across various social media platforms, such as Facebook, LinkedIn, and many more.
28
OG: title Property
This is used to set the title that displays for social media posts.
29
OG: Type Property
The type property is used to represent the type of content being shared on social media. Examples of this content include articles, websites, videos, or music.
30
OG: Image property
This is used to set the image shown for social media posts.
31
OG: URL Property
This is used to set the URL that users will click on for the social media posts.
32
Replaced Element
A replaced element is an element whose content is determined by an external resource rather than by CSS itself. An example would be an iframe element. iframe stands for inline frame. It's an inline element used to embed other HTML content directly within the HTML page.
33
Review iframe code
34
Optimizing Media
There are three tools to consider when using media, such as images, on your web pages: the size, the format, and the compression. A compression algorithm is used to reduce the size for files or data.
35
Image Formats
Two of the most common file formats are PNG and JPG, but these are no longer the most ideal formats for serving images. Unless you need support for older browsers, you should consider using a more optimized format, like WEBP or AVIF.
36
Image Licenses
An image under the public domain has no copyright attached to it and is free to be used without any restrictions. Images licensed specifically under the Creative Commons 0 license are considered public domain. Some images might be released under a permissive license, like a Creative Commons license, or the BSD license that freeCodeCamp uses.
37
SVGs
Scalable Vector Graphics track data based on paths and equations to plot points, lines, and curves. What this really means is that a vector graphic, like an SVG, can be scaled to any size without impacting the quality.
38
Audio and Video Elements
The audio and video elements allow you to add sound and video content to your HTML documents. The audio element supports popular audio formats like mp3, wav, and ogg. The video element supports mp4, ogg, and webm formats. If you want to see the audio player on the page, then you can add the audio element with the controls attribute:
39
Loop Attribute
The loop attribute is a boolean attribute that makes the audio replay continuously.
40
Muted Attribute
When present in the audio element, the muted boolean attribute will start the audio in a muted state.
41
Source Element
When it comes to audio file types, there are differences in which browsers support which type. To accommodate this, you can use source elements inside the audio element and the browser will select the first source that it understands. Here's an example of using multiple source elements for an audio element:
42
Poster Element
If you wanted to display an image while the video is downloading, you can use the poster attribute. This attribute is not available for audio elements and is unique to the video element.
43
Target Attribute
This attribute tells the browser where to open the URL for the anchor element. There are four important possible values for this attribute: _self, _blank, _parent and _top. There is a fifth value, called _unfencedTop, which is currently used for the experimental FencedFrame API. You probably won't have a reason to use this one yet.
44
_Self Value
This is the default value for the target attribute. This opens the link in the current browsing context. In most cases, this will be the current tab or window. Visit freeCodeCamp
46
_Parent Value
This opens the link in the parent of the current context. For example, if your website has an iframe, a _parent value in that iframe would open in your website's tab/window, not in the embedded frame. Visit freeCodeCamp
48
Path Definition
A path is a string that specifies the location of a file or directory in a file system. In web development, paths let developers link to resources like images, stylesheets, scripts, and other web pages.
49
Path Syntax
There are three key syntaxes to know. First is the slash, which can be a backslash (\) or forward slash (/) depending on your operating system. The second is the single dot (.). And finally, we have the double dot (..). The slash is known as the "path separator". It is used to indicate a break in the text between folder or file names. A single dot points to the current directory, and two dots point to the parent directory.
51
Relative Path
A relative path specifies the location of a file relative to the directory of the current file. It does not include the protocol or the domain name, making it shorter and more flexible for internal links within the same website. Here's an example of linking to the about.html page from the contact.html page, both of which are in the same folder:

Read more on the About Page

52
:link
This is the default state. This state represents a link which the user has not visited, clicked, or interacted with yet. You can think of this state as providing the base styles for all links on your page. The other states build on top of it.
53
:Visited
This applies when a user has already visited the page being linked to. By default, this turns the link purple - but you can leverage CSS to provide a different visual indication to the user.
54
:Hover
This state applies when a user is hovering their cursor over a link. This state is helpful for providing extra attention to a link, to ensure a user actually intends to click it.
55
:Focus
This state applies when we focus on a link.
56
:active
This state applies to links that are being activated by the user. This typically means clicking on the link with the primary mouse button by left clicking, in most cases.