HTML/CSS/JavaScript

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/120

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

121 Terms

1
New cards

What is HTML?

The raw data that a webpage is built out of using elements which includes text, links, cards, lists, and buttons.

2
New cards

What is CSS?

Adds style to those plain elements and positions that information, gives it color, changes the font.

3
New cards

What are elements?

Pieces of content wrapped in opening and closing tags HTML tags. They are the building blocks that defines the structure of a webpage.

4
New cards

What must elements have?

An opening tag <> and closing tag </>

5
New cards
<p>Describe each part of the following element:</p>

Describe each part of the following element:

  • <p> is the opening tag.

  • some text content represents content wrapped within the opening and closing tags.

  • </p> is the closing tag.

6
New cards

What is semantic HTML?

Using an element for its correct purpose.

7
New cards

What are void elements?

Elements that don't have a closing tag and are void of content like <img> and <br>.

8
New cards

What boilerplate?

Code with little to no alteration that is needed to run up a program.

9
New cards

What is the file called for a landing page for a website?

index.html

10
New cards

What does every HTML page start with?

A doctype declaration which tells the browser what version of HTML it should use to render the document. 

<!DOCTYPE html>

11
New cards

What comes after the doctype element?

The root elements <html> and </html>

12
New cards

What attribute should you include with the <html> element?

The attribute lang=“en” which declares that the primary language of the content is English.

13
New cards

What comes after the <html> element and what is it used for?

The <head> element which is where meta-information about the webpage is placed, and things required for our webpages to render correctly.

14
New cards

What two elements should be included in the <head> </head> elements?

<meta charset="UTF-8"> to ensures the webpage displays special symbols and characters from different languages correctly.


<title>My First Webpage</title> the title element displays the name of the page in the browser tab. If not included, the title in the tab would be the name of the HTML file.

15
New cards

What comes after the <head> </head> elements?

The <body> </body> elements which contains the content displayed on the page.

16
New cards
<p>What happens when you place text on a page using no elements?</p>

What happens when you place text on a page using no elements?

The text will condense together.

<p>The text will condense together.</p>
17
New cards

What element is used to create paragraphs in HTML?

The <p> element. This will add a new line after each of our paragraphs. 

<p>The &lt;p&gt; element.&nbsp;<span style="background-color: transparent;"><span>This will add a new line after each of our paragraphs.&nbsp;</span></span></p>
18
New cards

How do you create headings in HTML?

Using the <h1> to <h6> elements. <h1> </h1> should be used for page headers while <h2> through <h6> should be used for section headers.

<p>Using the &lt;h1&gt; to &lt;h6&gt; elements. &lt;h1&gt; &lt;/h1&gt; should be used for page headers while &lt;h2&gt; through &lt;h6&gt; should be used for section headers.</p>
19
New cards

How do you bold text in HTML? Create an example of bold text in a paragraph.

Use the <strong> element.

<p>Use the &lt;strong&gt; element.</p>
20
New cards

How do you make text italic in HTML? Create an example using italic text in a paragraph.

Use the <em> element.

<p>Use the &lt;em&gt; element.</p>
21
New cards

How do you make text smaller in HTML? Create an example in a paragraph.

Use the <small> element.

<p>Use the &lt;small&gt; element.</p>
22
New cards

How do you highlight text in HTML? Create and example using the paragraph element.

Use the <mark> element.

<p>Use the &lt;mark&gt; element.</p>
23
New cards

What happens when you nest an element into another element?

You create a parent and child relationship between them. Elements within the same nested level are siblings.

24
New cards

Create an example of a parent element with two children that are siblings.

knowt flashcard image
25
New cards

How do you create HTML elements? Create an example.

knowt flashcard image
26
New cards

What is an unordered list and how do you create an unordered list? Create an example of an unordered list.

Unordered lists don’t have list items in any order. Unordered lists are created using the <ul> element, and each item within the list is created using the list item element <li>.

<p><span style="background-color: transparent;"><span>Unordered lists don’t have list items in any order. Unordered lists are created using the </span></span><span style="background-color: transparent; font-family: &quot;Roboto Mono&quot;, monospace;"><span>&lt;ul&gt;</span></span><span style="background-color: transparent;"><span> element, and each item within the list is created using the list item element </span></span><span style="background-color: transparent; font-family: &quot;Roboto Mono&quot;, monospace;"><span>&lt;li&gt;</span></span><span style="background-color: transparent;"><span>.</span></span></p>
27
New cards

In an unordered list, how do you change the bullet for each list item?

Include the type attribute in the <ul> element and use the following:

  • circle

  • disc

  • square

28
New cards

What is an ordered list and how do you create an ordered list? Create an example of an ordered list.

Ordered lists have list items in a particular order. Ordered lists are created using the <ol> element. Each individual item in them is again created using the list item element <li>

29
New cards

In an ordered list, how do you change the number type for each list item?

Include the type attribute in the <ol> element and use the following:

  • a for lowercase letters

  • A for uppercase letters

  • i for lowercase Roman numerals

  • I for uppercase Roman numerals

30
New cards

Create an example of an ordered list with three list items that is nested into an unordered list with 3 items.

knowt flashcard image
31
New cards

What are description lists? How do you create them? Create and show an example with three items.

Description lists are used to outline multiple terms and their descriptions, as in a glossary. We use the <dl> to create the list and use the description term element <dt> for the term and <dd> for the term.

<p><span style="background-color: transparent;"><span>Description lists are used to </span><strong><span>outline multiple terms</span></strong><span> and their </span><strong><span>descriptions</span></strong><span>, as in a </span><strong><span>glossary</span></strong><span>. We use the </span></span><span style="background-color: transparent; font-family: &quot;Roboto Mono&quot;, monospace;"><span>&lt;dl&gt; </span></span><span style="background-color: transparent;"><span>to create the list and use the description term element </span></span><span style="background-color: transparent; font-family: &quot;Roboto Mono&quot;, monospace;"><span>&lt;dt&gt;</span></span><span style="background-color: transparent;"><span> for the term and </span></span><span style="background-color: transparent; font-family: &quot;Roboto Mono&quot;, monospace;"><span>&lt;dd&gt;</span></span><span style="background-color: transparent;"><span> for the term.</span></span></p>
32
New cards

How do you create a link to another website in HTML?

Use the <a> element. You must include the href attribute that contains the link.

33
New cards

Create an example of an <a> element that links to another website.

knowt flashcard image
34
New cards

When linking to another page or website, how do link open a new tab instead of changing the existing tab?

Include the attribute target=”_blank” in the <a> element.

35
New cards

What does the attribute rel=”noopener” do in <a> element?

Ensures that a link opened in a new tab or window cannot interact with or access the original page for security purposes.

36
New cards

What is the rel attribute?

Describes the relation between the current page and linked page.

37
New cards

What are relative links?

Links to other pages within your website/program and include the file path to other pages relative to the page you are on.

38
New cards

Create an example of a relative link for accessing a page in the same directory of the HTML you are currently in.

knowt flashcard image
39
New cards

Create an example of a relative link for accessing a page in a directory that is in the directory of the page you are currently on.

knowt flashcard image
40
New cards

What does ./ mean in regards to relative links?

./ specifies to your code that it should start looking for the file/directory relative to the current directory.

41
New cards

How do you display images in HTML?

Using the <img> element with the src attribute that has the link to the image.

42
New cards

What attributes should be included with the <img> element?

The src attribute, the alt attribute for alternative text if the image fails to load, height and weight attributes to set the images proportions.

43
New cards

Create an example of an image element that shows an image from an external website with the alt text, and with a height and width of 300 pixels.

knowt flashcard image
44
New cards

Create an example that displays an image from a directory that exists above from the directory you are currently in.

knowt flashcard image
45
New cards

What is CSS made up of?

Rules with each rule being made up of a selector and list of declarations made up of property-value pairs.

<p>Rules with each rule <span style="background-color: transparent;"><span>being made up of a selector and list of declarations made up of property-value pairs.</span></span></p>
46
New cards

What are selectors?

The HTML elements that CSS that rules are applied to.

47
New cards

What is the universal selector?

Selects every element in the entire document.

48
New cards

Show an example of the universal selector that applies the color purple.

knowt flashcard image
49
New cards

What is the type selector?

Selects all elements of the given element type. The selector is just the element itself.

50
New cards

Show an example of a CSS rule being applied to all divs with the color white.

knowt flashcard image
51
New cards

What is the class selector?

Select all elements with a given class. Uses a “.” at the beginning of the class.

52
New cards

What is a class?

An attribute of an HTML element that uses class=””

53
New cards

Create an example using the class selector that selects a div that contains some text. Turn the text red using a class selector.

knowt flashcard image
54
New cards

How do you add multiple classes to a single class attribute? Create an example.

Use spaces in the class attribute.

<div> class="alert-text severe-alert" </div>

55
New cards

What is the ID selector?

Selects an element with an ID.

56
New cards

What is an ID?

An attribute that only applies to one element. When we use IDs we use # instead of a period.

57
New cards

Create an example of a id selector using a div with text. Apply the background red to the element.

knowt flashcard image
58
New cards

Why should you try to avoid the ID attribute and relay on class attributes?

Using ID makes it more difficult to style elements in complex webpages that have lots of elements and classes.

59
New cards

What is the grouping selector?

Lets you group elements that share some of their property-key values. This is done using a comma separated list of elements in the selector.

60
New cards

Create a grouping selector for class read and unread. They should share the same color but each should have a different background color.

knowt flashcard image
61
New cards

What are chaining selectors?

Lets you apply rules to elements that have multiple classes or that has a class and ID.

62
New cards

Create a chaining selector that has a container div with two children. One is a div and one is a <p>. The div child should have two classes as well as the <p> element. They should share one class and the second class be different. Create a rule that applies both shared classes the color red.

The rule to share color:

.subsection { border: 2px solid red; }

<p>The rule to share color: </p><p><span style="background-color: transparent;"><span>.subsection { border: 2px solid red; }</span></span></p>
63
New cards

In the previous example, what are two ways you could apply a color to the div child? Create an example.

<p></p>
64
New cards
<p>Create two rules that use the chaining selector. One for subsection header and subsection preview. Apply the color red for one and the color blue for the other.</p>

Create two rules that use the chaining selector. One for subsection header and subsection preview. Apply the color red for one and the color blue for the other.

knowt flashcard image
65
New cards

Why cant you chain more than one type selector?

Because an element can’t be two different types at once. Chaining two type selectors like div and p would give us the selector divp, which wouldn’t work

66
New cards

What is the descendant combinator?

 Lets you select an element in a selector based on if it has a certain ancestor element. Uses spaces. Something like “.ancestor .child” would select the child regardless of how deep the nesting is.

67
New cards
<p>What would the following rule for the following HTML select?</p>

What would the following rule for the following HTML select?

Both the contents class in ancestor but not the content class that exists outside of ancestor.

68
New cards
<p>What does the following rule do for the following HTML?</p>

What does the following rule do for the following HTML?

Applies the color blue to the child class even though class derp exists between class ancestor and class child.

69
New cards

Create an example of a rule that selects only direct children of an element that is nested only one level deep and applies the color blue.

knowt flashcard image
70
New cards

Create a rule that sets the color and background color for a div.

<p></p>
71
New cards

What color formats can color properties accept?

Hexadecimal, RGB, and HSL?

72
New cards

How do you set the hexadecimal color value for a rule?

color: #1100ff

Sets the text color of the paragraph to a bright shade of blue using a hexadecimal color code (#1100ff). Format is # followed by six letter or number characters.

73
New cards

How do you set the rgb color value for a rule?

color: rgb(100, 0, 127);

  • Accepts integer or percentage values for red, green, and blue up to a 255 value.

74
New cards

How do you use the HSL color format for a rule?

color: hsl(15, 82%, 56%);

  • Hue (15) is the position on the color wheel (0–360).

  • Saturation (82%) is how intense or muted the color is (0% = grayscale, 100% = fully saturated).

  • Lightness (56%) is how light or dark the color is (0% = black, 100% = white).

75
New cards

How do you choose what font an element uses?

Using the font-family property. Can be a single value or a comma-separated list of values. If the font has spaces you must use quotes.

76
New cards

Provide an example of the font-family rule being applied to the body of an HTML element.

knowt flashcard image
77
New cards

How do you change the font-size of an element?

Use the font-size property.

<p>Use the font-size property.</p>
78
New cards

How do change the boldness of test in CSS?

Use the font-weight rule. The value can be the keyword bold or a number between 1 and 1000.

<p>Use the font-weight rule. The value can be the keyword bold or a number between 1 and 1000.</p>
79
New cards

How do you align text in an element using CSS?

Use the text-align rule. Includes values left, center, and right.

<p>Use the text-align rule. Includes values left, center, and right.</p>
80
New cards

Create an HTML file with a header saying “My First Example” and a text that says “This is a paragraph”. Have the entire background of the document be light blue, the header text white that is in the center of the document. The text be on the left side of the document in the font style of verdana with a size of 20 pixels. The back ground color of the text should be white.

knowt flashcard image
81
New cards

Why should you always specify the actual height and width of an image using the HTML attributes with the CSS properties height and width being the desired size?

The browser uses the HTML height and width properties to reserve the space on the page before the actual image file loads and then uses the CSS properties to prevent the image from shifting the page.

82
New cards

How do you link a CSS file to an HTML document?

Use the link attribute in the <head> section.

<p>Use the link attribute in the &lt;head&gt; section.</p>
83
New cards

What are relative and absolute units?

Absolute units are not relative to anything else and are generally to always be the same size. This includes px (pixels).

Relative length units are relative to something else. em, vh, vw, and rem relative units.

84
New cards

What is the default font-size for elements?

16px. The <body> element is 16px which all child elements inherit.

85
New cards

Is there a relationship between font size for a <p> element and its children?

The font size for a <p> element is inherited to all its children.

86
New cards

What is em?

A unit that's relative to the font size of the element (or its parent's font size for inherited properties).

  • 1em = the current font size (16px=16px).

  • 2em = twice the current font size (16px=32px).

  • 0.5em = half the current font size(16px=8px).

87
New cards

What is vh and vw?

Units relative to the browsers viewport which is the portion of the page that is immediately visible to the user.  Each integer in vh and vw correspond to one percentage point.

  • Viewport width is the width of the visible area of the browser window, measured in pixels.

    • 25wh=25% of the Viewport Height

  • Viewport height is the height of the visible area of the browser window, measured in pixels.

    • 15vh=15% of the Viewport Height

88
New cards

What is rem?

A relative unit that is relative to the font size of the root element <html> which is 16px. Use rem when you want consistent sizing across your page.

89
New cards
<p>In the following image, what is the size in pixels for the fields in the .parent, .child, .grandchild class?</p>

In the following image, what is the size in pixels for the fields in the .parent, .child, .grandchild class?

knowt flashcard image
90
New cards
<p>Create the HTML and CSS code for the following image. The first list uses a class that uses em relative unit for font-size while the second list uses rem for the font size.</p>

Create the HTML and CSS code for the following image. The first list uses a class that uses em relative unit for font-size while the second list uses rem for the font size.

knowt flashcard image
91
New cards
<p>Create this code using HTML and CSS.</p>

Create this code using HTML and CSS.

All the boxes have a padding, border, and background color. The first box uses a width in pixels, the second box uses a width in vw, and the last box uses a width in em.

*width: 10em; in .em class is 160px since the font-size inherited from the parent .wrapper is 1em which is 16px (10*160=160).*

<p>All the boxes have a padding, border, and background color. The first box uses a width in pixels, the second box uses a width in vw, and the last box uses a width in em.</p><p></p><p>*<span style="background-color: transparent;"><strong><span>width: 10em</span></strong><span>; in </span><strong><span>.em</span></strong><span> class is 160px since the font-size inherited from the parent .wrapper is 1em which is 16px (10*160=160).*</span></span></p>
92
New cards

What are percentages in CSS used for?

They are units always relative to some other value. If you set an element's font-size as a percentage, it will be a percentage of the font-size of the element's parent. If you use a percentage for a width value, it will be a percentage of the width of the parent.

93
New cards
<p>Recreate the image. All the boxes have a color background, color border, padding, and margin. The first and third box have a width of 200 pixels. The 2 and 4 box have a width of 40%. The last two boxes have a purple border around them that’s 400 pixels in length.</p>

Recreate the image. All the boxes have a color background, color border, padding, and margin. The first and third box have a width of 200 pixels. The 2 and 4 box have a width of 40%. The last two boxes have a purple border around them that’s 400 pixels in length.

The second pair of boxes are inside the wrapper. The box inside the wrapper that says “I am 40% wide” calculates its width from its parent <div> with the class called “wrapper” which is why it is smaller in terms of width to the other box.

<p><span style="background-color: transparent;"><span>The second pair of boxes are inside the wrapper. The box inside the wrapper that says “I am 40% wide” calculates its width from its parent &lt;div&gt; with the class called “wrapper” which is why it is smaller in terms of width to the other box.</span></span></p>
94
New cards

What does “margin: 1em 0;” mean?

1em: applies to top and bottom margins.

0 applies to left and right margins.

95
New cards
<p>Create the image. Hint: % is used for one of the elements in the code.</p>

Create the image. Hint: % is used for one of the elements in the code.

knowt flashcard image
96
New cards

How do you set the opacity for an element?

Use the opacity property. Accepts a number between 0 (fully transparent) and 1 (fully opaque).

97
New cards

How do you set an image as the background of an HTML file?

Use the Background-image: url(“....”); property.

98
New cards

How do you control whether or not a background image in an HTML file repeats or not?

The background-repeat property controls if/how the background image repeats. Options include:

  • repeat: Tiles the image both horizontally and vertically (default)

  • no-repeat: Shows the image only once (as in your example)

  • repeat-x: Repeats only horizontally

  • repeat-y: Repeats only vertically

99
New cards

How do you control the position of a background image in an HTML document?

The background-position property specifies where the background image is positioned within the element. “bottom left” places the image at the bottom-left corner. 

Keywords: top, bottom, left, right, center

100
New cards
<p>Recreate the image in HTML and CSS. The background image should not repeat and should be positioned in the bottom left.</p>

Recreate the image in HTML and CSS. The background image should not repeat and should be positioned in the bottom left.

knowt flashcard image