CSS Flashcards

1
Q

When is internal css styling useful?

A

Internal css styling is useful when applying styles to one html document.

Example:

<style>

 
html {
  background: red; 
}
</style>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

When is inline css useful?

A

Inline css is useful when adding css styling to a single element on your html page. Not good for adding styling to several elements.

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

What are the three ways to add css to an html website?

A
  1. Inline

<tag></tag>

  1. Internal

<style>

css
</style>
  1. External

<link></link>

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

What does CSS stand for?

A

Cascading Styles Sheets

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

What are named colors?

A

The <named-color> CSS data type is the name of a color, such as red, blue, black, or lightseagreen.</named-color>

Example:
color: rebeccapurple;

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

What are the two different methods or syntax for writing CSS code?

A

CSS ruleset and CSS inline style

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

What is a selector? (Ruleset)

A

A selector is the beginning of the ruleset used to target the element that will be styled.

Ex:
p {
color: blue;
}

p = the selector

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

What is a declaration block? (Ruleset)

A

The code in-between (and including) the curly braces ({ }) that contains the CSS declaration(s).

p {
color: blue;
}

The declaration block = {color: blue:)}

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

What is a declaration? (Ruleset)

A

A declaration is what we call the property and value that we want to add to an element. The property is what we want to change and the value is how we want to change it.
p {
color: blue;
}

The declaration = color: blue;

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

What is a property? (Ruleset)

A

A property specifies the aspects of the element you want to change. For example, color, font, width, height and border.

p {
color: blue;
}

property = color

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

What is a value? (Ruleset)

A

The second part of the declaration. Values specify the settings you want to use for the chosen properties. For example, if you want to specify a color property then the value is the color you want the text in these elements to be.

p {
color: blue;
}

value = blue

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

Style attribute

A

The style attribute is used to add CSS inline styles to an HTML element. It is an attribute available to all elements (global attribute).

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

What do we often call the CSS code inside the <style> element in a html file?</style>

A

internal stylesheet

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

How do we link html and css files?

A

use the link element to link HTML and CSS files together. The link element must be placed within the head of the HTML file. It is a self-closing tag and requires the following attributes:

  1. href
  2. rel -this attribute describes the relationship between the HTML file and the CSS file. Because we are linking to a stylesheet, the value should be set to stylesheet.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does the type selector do?

A

A selector is used to target the specific HTML element(s) to be styled by the declaration. The type selector matches the type of the element in the HTML document.

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

What is the type selector also referred to as?

A

The type selector is sometimes referred to as the tag name or element selector.

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

What are four ways we can represent font size in css?

A

Pixels, points, em (pronounced “m”), rem.

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

How is 1em defined?

A

1 em is defined as the full width of the letter M. In practical terms, 1 em is going to be 100 percent of the parent size.

If the parent element is 20px than 1em would be 20px. If the parent element is 20px, a child element set to 2 em would be 40 px (twice as much).

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

How is rem different from em?

A

rem is a relative size just like em but instead of being relative to the parent it is relative to the root of your html file (which is usually an html element).

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

When we are setting the font size should we use rem or em and why?

A

It’s recommended to use rem because when you have different elements embedded in others it can become difficult to identify the parent elements.

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

What does the universal selector do?

A

The universal selector selects all elements of any type. The universal selector uses the * character
* {
font-family: Verdana;
}

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

What is a common way for selecting an element when working with html and css?

A

Using the class attribute.

Ex:
p class=’brand’ Sole Shoe Company /p

Important note: Greater than/less than have been removed in code above.

.brand {

}

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

How can we add multiply classes to an html element?

A

We can add multiple classes to an HTML element’s class attribute by separating them with a space.

Ex:

.green {
color: green;
}

.bold {
font-weight: bold;
}

h1 class=’green bold’

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

What do we use to when we want to give an html element its own unique style?

A

large-title {

We use the id attribute.
h1 id=’large-title’ …./h1

Important note: Greater than/less than have been removed in code above.

}

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

How is the class attribute different than the id attribute?

A

The class attribute accepts multiple values and can be used broadly throughout an HTML document. The element’s id can only have a single value and can only be used once per page.

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

What is the attribute selector?

A

Attribute selectors are CSS selectors that match elements based on their attributes. This can be an attribute alone, such as [type], or it can be an attribute and value combination, such as [type=checkbox] or [for=”email”].

Example:
p[draggable] {
color: red
}

<p>Drag Me</p>

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

What is one advantage of using the attribute selector compared to class or id?

A

When we use the attribute selector we do not need to write any new code (new html markup- id or class)

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

What are pseudo-class selectors?

A

Pseudo-class selectors allow you to change the appearance of elements when a user is interacting with them.

For example: When you’re filling out a form and the submit button is grayed out and disabled. But when all of the fields have been filled out, the button has color showing that it’s active.

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

:hover

A

This is applied when a user hovers over an element with a pointing device such as a mouse. Commonly used to change the appearance of links and buttons when a user places their cursor over them.

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

:active

A

Active is applied when an element is being activated by a user (a button being pressed or link being clicked). Makes the user “feel” like it is being pressed.

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

:focus

A

This is applied when an element has focus. Any element that you can interact with (link, form) can have focus. It is generally triggered when the user clicks or taps on an element or selects it with the keyboard’s tab key.

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

:visited

A

Visited represents links that the user has already visited. For privacy reasons, the styles that can be modified using this selector are very limited.

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

Why should ID’s be used sparingly?

A

ID’s should be used sparingly because IDs override the styles of types and classes. We should only use them on elements that need to always appear the same.

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

What is specificity?

A

Specificity is the order by which the browser decides which CSS styles will be displayed.

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

What are the four broad categories when we are determining the level of importance for a css rule?

A

Position, specificity, type, and importance.

position- is the rule in a higher or lower position in the css relative to other rules.

Example: li {
color: red;
color: blue:
} (blue will be shown - the lower/the more important)

specificity - how specific a selector is ( type, class, attribute, id).

type - external, internal, inline styling. (inline is most important)

importance - using the important keyword. Ex:
h1 {
color: red;
color: green !important; (must have space in between green and important.)

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

What is a best practice in regards to specificity?

A

A best practice in CSS is to style elements while using the lowest degree of specificity so that if an element needs a new style, it is easy to override.

It’s best to style with a type selector, if possible. If not, add a class selector. If that is not specific enough, then consider using an ID selector.

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

What is chaining?

A

Chaining is when we combine multiply selectors in the CSS stylesheet.

For example:

h1.special {

}

This code will only affect the h1 element that has the class special. If we had a p element with the class special it would not be styled.

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

What is the descendant combinator?

A

The descendant combinator is a selector that allows us to select elements that are nested within other elements.

Example:

.main-list li {

}

This will select the element with the class main-list (ul) and then the descendant element (li). Must include a space between the class name and descendant element.

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

How can we increase the specificity of a CSS selector?

A

We can add more specificity by adding more than one tag, class, or ID to a CSS selector.

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

How do you add CSS styles to multiple selectors all at once?

A

We can separate the selectors by a comma to apply the same style to many selectors at once.

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

font-family property

A

The font-family property is used to change the typeface on your webpage.

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

What should you keep in mind when setting the font on your web page?

A
  1. The font must be installed on the users computer or downloaded with the site.
  2. Use web safe fonts -a group of fonts supported across most browsers and operating systems.
    3.Unless you are using web safe fonts, the font you choose may not appear the same on all browsers and operating systems.
    4.When the name of a typeface consists of more than one word, it’s a best practice to enclose the typeface’s name in quotes

Example: “Times New Roman”

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

What must we make sure we do when we are setting an elements position to absolute?

A

If you want a specific element positioned relative to another element, you must make sure to set the ancestor’s (what we are positioning it to) position to relative. If we do not do this then the element will be positioned relative to the document (top left corner).

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

font-size property

A

We use the font-size property to change the size of text on the web page.

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

font-weight property

A

The font-weight property controls how bold or thin text appears.

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

Why does the font-weight value “normal” exist?

A

If we were to make all of the text bold, we could use the normal value to make a specific part of the text not bold.

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

text-align property

A

To align text we can use the text-align property. The text-align property will align text to the element that holds it, otherwise known as its parent.

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

color property

A

The color property styles an element’s foreground color.

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

background-color property

A

The background-color property styles an element’s background color.

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

opacity

A

Opacity is the measure of how transparent an element is. It’s measured from 0 to 1, with 1 representing 100%, or fully visible and opaque, and 0 representing 0%, or fully invisible.

The opacity property can be used to make elements fade into others for a nice overlay effect.

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

background-image

A

The background-image property will set the element’s background to display an image. The value provided is a url.

Ex:
.main-banner {
background-image: url(‘images/mountains.jpg’);
}

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

!important

A

!important can be applied to specific declarations, instead of full rules. It will override any style no matter how specific it is. As a result, it should almost never be used.

One justification for using !important is when working with multiple stylesheets.

Ex:

p {
color: blue !important;
}

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

What is the box model?

A

All elements on a web page are interpreted by the browser as “living” inside of a box.

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

What does the box model include?

A

The model includes:
1.The content area’s size (width and height)
2.The element’s padding, border, and margin.

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

width and height (box model)

A

The width and height of the content area.

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

Padding (box model)

A

The amount of space between the content area and the border. Padding is like the space between a picture and the frame surrounding it.

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

Border (box model)

A

The thickness and style of the border surrounding the content area and padding. Like a frame around a painting.

Borders can be set with a specific width, style, and color

Ex:

p {
border: 3px solid coral;
}

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

How can we further modify a border once we define it?

A

We can add more specific rules in the next line of code.

Ex:
Border: 30px solid black;
Border-top: 0px;

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

Margin (box model)

A

The amount of space between the border and the outside edge of the element.

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

What happens when the width and height of an element are set in pixels?

A

It will be the same size on all devices — an element that fills a laptop screen will overflow a mobile screen.

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

What are the different parameters for a border’s width?

A

A border’s thickness can be set in pixels or with one of the following keywords: thin, medium, or thick.

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

What are the different parameters for a border’s style?

A

Web browsers can render any of 10 different styles. These styles include: none, hidden, dotted, dashed, double, groove, ridge, inset, outset, and solid.

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

What are the different parameters for a border’s color?

A

The color of the border. Web browsers can render colors using a few different formats, including 140 built-in color keywords.

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

What is the default border in CSS?

A

medium, none, color Where color is the current color of the element.

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

How can you modify the corners of an element’s border box?

A

You can modify the corners of an element’s border box with the border-radius property.

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

How can you create a border that is a perfect circle?

A

You can create a border that is a perfect circle by first creating an element with the same width and height, and then setting the radius equal to half the width of the box, which is 50%.

Ex:
div.container {
height: 60px;
width: 60px;
border: 3px solid blue;
border-radius: 50%;
}

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

How can you be more specific about the amount of padding on each side of a box’s content?

A

You can use the following properties:
1. padding-top
2. padding-right
3. padding-bottom
4. padding-left

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

What is a shorthand property?

A

A shorthand property is a declaration that uses multiple properties as values.

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

What is padding shorthand?

A

Padding shorthand allows you to specify all of the padding properties as values on a single line.

You can specify these properties using 4, 3, or 2 values.

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

Padding shorthand with four values

A

The amount of padding for each section is specified in a clockwise rotation: top, right, bottom, left.

Example:

p.content-header {
padding: 6px 11px 4px 9px;
}

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

Padding shorthand with three values

A

This is used when the amount of padding is equal for the left and right sides. The first value sets the padding-top value (5px), the second value sets the padding-left and padding-right values (10px), and the third value sets the padding-bottom value (20px).

Example:

p.content-header {
padding: 5px 10px 20px;
}

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

Padding shorthand with two values

A

This shorthand is used when the top and bottom sides are equal and the left and right sides are equal. The first value sets the padding-top and padding-bottom values (5px), and the second value sets the padding-left and padding-right values (10px).

Example:
p.content-header {
padding: 5px 10px;
}

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

What is div short for and why do we use it?

A

Div is short for content division element and we use when we want to group different bits of content together (style it or lay it out together).

We can put as many elements as we want in between or div elements.

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

How does margin shorthand work?

A

Margin shorthand uses all of the same syntax as padding shorthand (4 values, 3 values, 2 values)

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

How can you center content using the margin property?

A

You can center content using the margin property by making sure you set a width and using the syntax 0 auto for the margin property.

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

What does the 0 auto syntax do when using the margin property?

A

The 0 sets the top and bottom margins to 0 pixels. The auto value tells the browser to adjust the left and right margins until the element is centered within its containing element.

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

What are the top and bottom margins also called?

A

vertical margins

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

What are the left and right margins also called?

A

horizontal margins

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

What is one big difference between vertical and horizontal margins?

A

Vertical margins collapse and horizontal margins do not. If we have two elements with the top margin of one set to 20px and the bottom margin of the other set to 30px, the margin will only be dependent on the larger margin (the margin will be 30px).

Horizontal margins will combine. Element 1 margin-right is 30 px and Element 2 margin-left is 30 px, total space between them will be 60px.

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

Why do we use min-width and max-width properties?

A

Content, like text, can become difficult to read when a browser window is narrowed or expanded. These two properties ensure that content is legible by limiting the minimum and maximum widths of an element.

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

How can you limit the minimum and maximum height of an element?

A

Using the min-height and max-height properties.

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

overflow property

A

The overflow property controls what happens to content that spills, or overflows, outside its box.

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

What are the most common values for the overflow property?

A
  1. hidden
  2. scroll
  3. visible
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
84
Q

What is the hidden value for the overflow property?

A

The overflow value will allow any content that overflows will be hidden from view.

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

What is the scroll value for the overflow property?

A

The scroll value will add a scrollbar to the element’s box so that the rest of the content can be viewed by scrolling.

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

What is the visible value for the overflow property?

A

The visible value will allow the overflow content will be displayed outside of the containing element.

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

What are user agent stylesheets?

A

Default stylesheets the major browser have.

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

How can developers reset the default stylesheet values?

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

What does the box sizing property control?

A

It controls the type of box model the browser should use when interpreting a web page.

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

What is the default value for the box -sizing property?

A

content-box

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

How can we reset the entire box model and specify a new one?

A

By setting the box sizing property to border-box.

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

Why is the border-box value important?

A

The border-box value ensures that the the height and width of the box will remain fixed. (padding and the boarder will not add to the width or height of the box).

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

What are block- level elements?

A

Block-level elements are elements that create a block the full width of their parent elements, and they prevent other elements from appearing in the same horizontal space.

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

How can we change the default position of an element?

A

We can change the default position of an element by using the position property.

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

What are the five values for the position property?

A

static, relative, absolute, fixed, sticky

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

What is the default value for the position property?

A

static

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

What does the relative value for the position property allow you to do?

A

The relative value allows you to position an element relative to its default static position on the web page.

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

What must you add to the position declaration?

A

You must add an offset property (top, bottom, left, right) to indicate where the element should be positioned on the page.

Ex:
postion: relative:
top: 50px;
left: 50px;

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

What type of values can you use for the offset property (related to size)?

A

Pixels, rem, percentages

Ex:
postion: relative:
top: 50px;
left: 50px;

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

Does relative positioning affect the positioning of other elements?

A

no

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

What does the absolute value for the position property allow you to do?

A

The absolute value allows you to position the element relative to it’s closest parent element using the offset properties.

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

What does the fixed value for the position property allow you to do?

A

fix an element to a specific position on the page (regardless of user scrolling)

Example:
header {
position: fixed;
top: 0px;
left: 0px;
}

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

What’s a website feature that commonly uses the fixed value for position?

A

Navigation bars

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

What does the sticky value for the position property allow you to do?

A

The sticky value allows an element to behave like a relatively-positioned element until it reaches a certain point and then starts behaving like a statically-positioned element (“stick at that point)

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

What does the z-index property control?

A

The z-index property controls how far back or how far forward an element should appear on the web page when elements overlap.

Note: The larger z-index with overlap the smaller index (1 vs 0 or 10 vs unidentified)

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

What type of values does the z-index property accept?

A

integers

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

What does the display property do?

A

The display property controls if an element is treated as a block or inline element and the layout used for its children (flow layout, grid or flex)

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

What are three values for the display property?

A

inline, block, inline-block

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

What are inline elements?

A

Inline elements have a box that wraps tightly around their content and only take up the amount of space necessary to display their content. They also do not require a new line after each element.

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

What can we not alter with inline elements?

A

We can not alter the size of inline elements (height and width). The default to the height and width of there content.

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

What happens when you set the display property to none?

A

It makes that element disappear.

112
Q

How can we get block elements to be displayed as inline elements?

A

We can make any element an inline element by using the display property.

Ex:

h1 {
display: inline;
}

113
Q

What are block-level elements?

A

Block-level elements are elements that fill the entire width of the page by default (width can be changed using css).

114
Q

What is the default height for block-level elements?

A

Unless we manually change it, they are the height necessary to contain their content.

115
Q

What are some examples of block-level elements?

A

headings, , paragraphs, divs, footer, address, article, aside, block quote, details, dialogue, description list, field set, figure caption, figure, etc.

116
Q

What does the inline-block element allow?

A

The inline-block element allows you to combine features of both inline and block elements. Inline-block elements can appear next to each other and we can specify their dimensions using the width and height properties.

117
Q

What are the best examples of default inline-block elements?

A

images

118
Q

What is the float property commonly used for?

A

The float property is commonly used for wrapping text around an image.

119
Q

The float property is often set using what values?

A

left - moves, or floats, elements as far left as possible.
right - moves elements as far right as possible.

120
Q

What should we include to make sure the float property is actually visible?

A

A specified width

121
Q

What is the clear property used for?

A

The clear property specifies how elements should behave when they bump into each other on the page.

122
Q

What are the values the clear property can take?

A

left- left side of element can not touch with any other element in the parent element)
right- right side of element can not touch with any other element in the parent element
both - neither side of the element can touch with any other element in the parent element
none—the element can touch either side.

123
Q

What are the three ways we can describe colors in CSS?

A
  1. Named colors — English words that describe colors, also called keyword colors
  2. RGB — numeric values that describe a mix of red, green, and blue
  3. HSL — numeric values that describe a mix of hue, saturation, and lightness
124
Q

What is the foreground color?

A

Foreground color is the color that an element appears in.

125
Q

What does the color property do?

A

The color property styles an element’s foreground color.

126
Q

What does the background-color property do?

A

The background-color property styles an element’s background color.

127
Q

What do the characters in a hex color represent?

A

The characters represent values for red, blue and green.

128
Q

What do hex colors begin with?

A

A hex color begins with a hash character (#)

129
Q

What is hex short for and what is it?

A

Hexadecimal. Hexadecimal is a number system that has sixteen digits, 0 to 9 followed by “A” to “F”

130
Q

How many digits does the hexadecimal system have?

A

16 (0-15)

131
Q

How are RGB colors and hex colors different?

A

RGB colors use decimal numbers instead of hexadecimal numbers.

132
Q

What do each of the three values in a RGB color represent?

A

Each of the three values represents a color component, and each can have a decimal number value from 0 to 255.

The first number represents the amount of red, the second is green, and the third is blue.

133
Q

What does the syntax for a RGB color look like?

A

h1 {
color: rgb(143, 188, 143);
}

134
Q

What does HSL stand for?

A

hue-saturation-lightness color scheme

135
Q

What do each of the three values in a HSL color represent?

A

1st number -represents the degree of the hue (can be between 0 and 360)
2nd number - saturation (percentages)
3rd number- lightness (percentages)

136
Q

What is the syntax for a HSL color?

A

h1 {
color: hsl(120, 60%, 70%);
}

137
Q

What is hue?

A

Hue refers to an angle on a color wheel. Red is 0 degrees, Green is 120 degrees, Blue is 240 degrees, and then back to Red at 360.

138
Q

What is saturation?

A

Saturation is the intensity or purity of the color. The saturation increases towards 100% as the color becomes richer. The saturation decreases towards 0% as the color becomes grayer.

139
Q

What is lightness in terms of HSL color?

A

Lightness refers to how light or dark the color is. Halfway, or 50%, is normal lightness. Imagine a sliding dimmer on a light switch that starts halfway.

Sliding towards 100% brings closer to white. Sliding down towards 0% brings closer to black.

140
Q

What’s a major benefit of HSL colors?

A

HSL makes it easy to adjust colors (change the lightness, saturation, or hue).

141
Q

What does opaque mean?

A

Non-transparent

142
Q

What is opacity?

A

Opacity is the amount of transparency and element has.

143
Q

How can we use opacity in the HSL color scheme?

A

by adding alpha (a) at the end of the hsl syntax (hsla)

144
Q

What is the syntax for HSL with opacity?

A

h1 {
color: hsla(34, 100%, 50%, 0.1);
}

145
Q

What is alpha?

A

Alpha or opacity is a decimal number from 0 to 1.
0 = completely transparent
1 = opaque
0.5 = half transparent

146
Q

How can we add transparency to a RGB value.

A

by adding alpha at the end of the rgb syntax (rgba).

Example:

h1 {
color: rgba(234, 45, 98, 0.33);
}

147
Q

What can alpha (opacity) not be used with?

A

Named colors

148
Q

How can we add opacity to hex values?

A

By adding a two-digit hexadecimal value to the end of the six-digit representation (#52BC8280), or a one-digit hexadecimal value to the end of the three-digit representation (#F003)

Hex opacity ranges from 00 (transparent) to FF (opaque).

149
Q

What is the named color keyword for zero opacity and what is it’s syntax?

A

transparent
Syntax:

h1 {
color: transparent;
}

150
Q

When can hex colors be abbreviated?

A

Hex colors can be abbreviated when both characters of all three values colors are repeated.
Example:
#0000ff can be abbreviated by #00f

151
Q

What property do we learn to change the font?

A

font-family

h1 {
font-family: Arial;
}

152
Q

What should we use when using a typeface with multiple words, like Times New Roman?

A

We should use quotation marks (‘ ‘) to group the words together.

Example:
h1 {
font-family: ‘Times New Roman’;
}

153
Q

What are web safe fonts?

A

Fonts that appear the same across all browsers and operating systems.

154
Q

What is a font stack?

A

A font stack usually contains a list of similar-looking fonts.

Example:
h1 {
font-family: Caslon, Georgia, ‘Times New Roman’;
}

155
Q

What’s a fall back font?

A

Web safe fonts that can be used if your preferred font is not available.

156
Q

What is the difference between Serif and Sans-serif fonts?

A

Serif fonts have extra details (feet at the bottom) on the ends of each letter, as opposed to Sans-Serif fonts, which do not have the extra details.

157
Q

What keywords can also be used as a final fallback font if nothing else in the font stack is available.

A

Serif and Sans-Serif

158
Q

What keyword values can the font-weight property take?

A
  1. bold: Bold font weight.
  2. normal: Normal font weight. This is the default value.
  3. lighter: One font weight lighter than the element’s parent value.
  4. bolder: One font weight bolder than the element’s parent value
159
Q

What’s the range for numerical values that the font-weight property can take?

A

Numerical values can range from 1 (lightest) to 1000 (boldest)

160
Q

What is the common practice when using numerical values for the font-weight property?

A

Common practice to use increments of 100.
400 = normal
700 = bold

161
Q

font-weight syntax with numerical values

A

.left-section {
font-weight: 700;
}

162
Q

font-weight syntax with keyword values

A

.right-section {
font-weight: bold;
}

163
Q

How can you italicize text using css?

A

You can italicize text with the font-style property.

164
Q

What is the syntax for italicize? (CSS)

A

h3 {
font-style: italic;
}

165
Q

How can we make text appear in all uppercase or lowercase?

A

By using the text-transform property?

166
Q

What is the syntax for making text appear all uppercase or lowercase?

A

h1 {
text-transform: uppercase;
}

*we can also replace the uppercase keyword with lowercase

167
Q

Why should we use CSS to make text appear in all uppercase/lowercase and not simply type it in our html file?

A

Depending on the type of content a web page displays, it may make sense to always style a specific element in all uppercase or lowercase letters. (breaking news)

It also helps avoiding uppercase text in the HTML file, which could make code difficult to read.

168
Q

What does the letter-spacing property do?

A

The lettering-spacing property allows us to set the horizontal spacing between the individual characters in an element.

169
Q

What is the syntax used for setting the horizontal spacing between the individual characters in an element?

A

p {
letter-spacing: 2px;
}

170
Q

What are the values that the letter-spacing property can take?

A

The letter-spacing property takes length values in units, such as 2px or 0.5em.

171
Q

Is it common to increase the spacing between words and characters in words?

A

No, but it may help enhance the readability of bolded or enlarged text.

172
Q

What value is recommended for word spacing?

A

For word spacing, using em values are recommended because the spacing can be set based on the size of the font.

173
Q

What does the word-spacing property do?

A

The word spacing property sets the space between words.

174
Q

What does the line-height property do?

A

The line-height property sets how tall we want each line containing our text to be.

175
Q

What type of values can the line-height property take?

A

Line height values can be a unitless number, such as 1.2, or a length value, such as 12px, 5% or 2em.

176
Q

What is the syntax for line-height?

A

p {
line-height: 1.4;
}

177
Q

What value is preferred for line-height?

A

Generally, the unitless value is preferred since it is responsive based on the current font size. (Changing the font-size will will automatically readjust the line height)

178
Q

How can we use font services like Adobe fonts, Google fonts, and fonts.com?

A

We can use the services by using the link element. These services host fonts that you can link to from your HTML document

179
Q

How do you use Google Fonts?

A
  1. Go to Google Fonts online.
  2. Select the font you want.
  3. In the list of style variations pick the style you prefer.
  4. Click “+ Select this style”
    5.Copy the provided <link></link> element, and paste it into the <head> element inside index.html.
180
Q

What is @font-face?

A

The at @font-face ruleset can be used to add fonts to the CSS stylesheet.

181
Q

What are the different file formats for web fonts?

A

OTF (OpenType Font)
TTF (TrueType Font)
WOFF (Web Open Font Format)
WOFF2 (Web Open Font Format 2)

182
Q

What should we include with our @font-face rule to ensure compatibility on all browsers?

A

We should include TTF, WOFF, and WOFF2 formats

183
Q

Why should we include different formats with our @font-face rule?

A

The different formats are a progression of standards for how fonts will work with different browsers, with WOFF2 being the most progressive.

184
Q

Where should we define the @font-face ruleset?

A

at the top of your CSS stylesheet.

185
Q

What is the syntax for defining the @font-face ruleset?

A

@font-face {
font-family: ‘MyParagraphFont’;
src: url(‘fonts/Roboto.woff2’) format(‘woff2’),
url(‘fonts/Roboto.woff’) format(‘woff’),
url(‘fonts/Roboto.ttf’) format(‘truetype’);
}

*font-family property is used to set a custom name for the downloaded font.

186
Q

What is the syntax for using the @font-face ruleset once it is defined?

A

p {
font-family: ‘MyParagraphFont’, sans-serif;
}

187
Q

nth-of-type(even)

A
188
Q

last-of-type

A
189
Q

border-collapse property

A
190
Q

How can you add space in between the cells of a table

A
191
Q

What are signifiers?

A

Signifiers are indicators that offer clues about how to interact with new objects or situations.
Ex: Teacups with handles. Handles signify to the user that they can pick up the cup.

192
Q

What should you not do if you are using underline value for links in website?

A

You should not use the underline feature in other aspects of the website (only for links).

193
Q

Why are html title attributes helpful?

A

The title attribute is useful as additional context or advisory text for clickable elements.

194
Q

What is a tooltip?

A

A tooltip is a common graphical user interface (GUI) element in which, when hovering over a screen element or component, a text box displays information about that element.

Also known as a infotip or hint.

195
Q

How do you add a tooltip to an element?

A

You can easily add a tooltip to an element by adding a title attribute to the front tag.

196
Q

What should hover states not be used for?

A

Hover state styling should never be used as the sole indication that something is a link.

197
Q

cursor property

A

The cursor property changes the default appearance to a pointing hand.

a {
cursor: pointer;
}

198
Q

What is the correct ordering of link state pseudo-class rules?

A
  1. :link
  2. :visited
  3. :hover
  4. : active
199
Q

What is skeuomorphism?

A

Skeuomorphism is the concept of UI elements that replicate or imitate real-life counterparts

200
Q

What is flat design

A

Flat design is an alternative approach to skeuomorphism which embraces the fact that computer interfaces do not necessarily need to model real-life interfaces.

201
Q

What does the box-shadow property do?

A

The box-shadow property adds shadow effects around an element’s frame. You can set multiple effects separated by commas. A box shadow is described by X and Y offsets relative to the element, blur and spread radius, and color.

202
Q

Why is button text important in flat designs?

A

There is an increase chance that users will be confused with flat designs. Therefore, we should pair buttons with specific, descriptive labels. Ex: Click here vs submit form.

203
Q

What are affordances?

A

Potentials for interaction are collectively called the affordances of an object.

204
Q

What is the function of UX patterns?

A

User experience (UX) patterns establish reusable solutions to common problems. Ex: handles are used on objects of all shapes, sizes, and purposes to indicate that users can initiate an action by grabbing the handle with their hand(s).

205
Q

What is the difference between primary and secondary navigation?

A

Primary navigation system typically contains the most important links and buttons that need to be displayed on every single page of the site. While secondary navigation (or breadcrumb) navigation usually consists of a clickable list of pages or attributes that led to the current page.

206
Q

Child selector

A

The child selector selects all elements that are the children of a specified element.

div > p {
background-color: yellow;
}

207
Q

What is the adjacent sibling combinator?

A

The adjacent sibling combinator will only select two li‘s when they are immediately next to each other, with the same parent. The element that actually gets selected is the second element of this sibling pair.

.breadcrumb li+li::before {
content: “/”;

}

208
Q

::before

A

::before creates a pseudo-element that is the first child of the selected element. It is often used to add cosmetic content to an element with the content property. It is inline by default.

209
Q

What are gutters?

A

Gutters are the negative space between each column. Gutters help in ensuring the columns don’t run together

210
Q

What are four main ways to create a responsive layout?

A

Media queries, css grid, css flexbox, external frameworks (like bootstrap).

211
Q

How does a media query work?

A

We replace our selector with a media query and write code within the curly braces for what should happen for screen sizes below a certain width.

Example:
@media (max-width: 600px) {
/* css code for screens below or equal to 600px wide*/
}

212
Q

What is a breakpoint?

A

The breakpoint comes right after the @ media keyword and identifies anything at or below a certain point (like 600px) the styling stated within the curly braces should be used.

Example:
@media (max-width: 600px) {
h1 {
font-size: 15px;
}
}

213
Q

What does the min-width keyword do (media query)?

A

The min-width keyword will run a specific block of code if the size of the screen is at or above a certain width. Opposite of max-width. Targeting bigger screens.

214
Q

How can we target a specific size using media queries?

A

By combining minimum and maximum width to get a size in between the two.

Example:
@media (min-width: 600px) and (max-width: 900px) {
/* styles for screen between 600px and 900px */
}

We can also do the opposite:
@media (min-width: 900px) and (max-width: 600px) {
/* styles for screen between 900px and 600px */
}

215
Q

What does the print keyword do when using media queries?

A

Allows you to use the media query to target only when your website is being printed and to give it a different layout.

syntax
@ media print (orientation: landscape) {
/* styles for landscape orientation*/
}

216
Q

What are the three major components of a grid?

A

columns, gutters, and margins

217
Q

What are rows used for?

A

Rows are commonly used in web designs to group content together and re-order other content to allow for more whitespace.

A row can also be used to force content away from an area that has remaining columns not used.

218
Q

What are flex containers?

A

A flex container is an element on a page that contains flex items.

219
Q

What are flex items?

A

Flex items are all direct child elements of a flex container

220
Q

What is the syntax to make an element a flex container?

A

div.container {
display: flex;
}

221
Q

What is the syntax for making flex containers that are also inline?

A

.container {
width: 200px;
height: 200px;
display: inline-flex;
}

222
Q

What does the justify-content property do? (flexbox)

A

The justify-content property controls the alignment along the main axis. It helps distribute extra free space leftover when either all the flex items on a line are inflexible, or are flexible but have reached their maximum size.

223
Q

What are the five commonly used values for the justify-content property?

A
  1. Flex start : all items will be positioned in order, starting from the left of the parent container
  2. Flex end: all items will be positioned in order, with the last item starting on the right side of the parent container.
  3. Center: all items will be positioned in order, in the center of the parent container.
  4. Space around: items will be positioned with equal space before and after each item, resulting in double the space between elements.
  5. Space between: items will be positioned with equal space between them, but no extra space before the first or after the last elements.
224
Q

How do we space flex items vertically?

A

We can align flex items vertically within the container using the align-items property.

225
Q

What is the syntax for the align-items property?

A

.container {
align-items: baseline;
}

226
Q

What are five commonly used values for the align-items property?

A
  1. flex-start — all elements will be positioned at the top of the parent container.
  2. flex-end — all elements will be positioned at the bottom of the parent container.
  3. center — the center of all elements will be positioned halfway between the top and bottom of the parent container.
  4. baseline — the bottom of the content of all items will be aligned with each other.
  5. stretch — if possible, the items will stretch from top to bottom of the container (this is the default value; elements with a specified height will not stretch; elements with a minimum height or no height specified will stretch).
227
Q

Describe what the flex-grow property does.

A

The flex-grow property allows us to specify if items should grow to fill a container and also which items should grow proportionally more or less than others.

*Flex-grow is declared on items.

228
Q

Describe what the flex-shrink property does.

A

the flex-shrink property can be used to specify which elements will shrink and in what proportions.

229
Q

What is not affected by flex-grow and flex-shrink properties?

A

margin

230
Q

What is the default value for flex-shrink?

A

1

231
Q

What does the flex-basis property do?

A

flex-basis allows us to specify the width of an item before it stretches or shrinks.

232
Q

What is the syntax for flex-basis?

A

.side {
flex-grow: 1;
flex-basis: 100px;
}

.center {
flex-grow: 2;
flex-basis: 150px;
}

233
Q

What does the flex property allow you to do (shorthand)?

A

The flex property allows you to declare flex-grow, flex-shrink, and flex-basis all in one line.

234
Q

What is the syntax for the flex property shorthand?

A

.big {
flex: 2 1 150px;
}

.small {
flex: 1 2 100px;
}

Note: the values declared are flex-grow, flex-shrink, and flex-basis (in that order).

235
Q

Is there a way to set flex-shrink and flex-basis with a 2 value shorthand?

A

No

236
Q

What is the shorthand for a flex-basis of 0, a flex-grow of 1, and a flex-shrink of 1?

A

flex: 1

237
Q

What does the flex-wrap property allow us to do with our content?

A

The flex-wrap property allows flex items to move to the next line when necessary.

238
Q

What are the three values that the flex-wrap property can use?

A
  1. wrap — child elements of a flex container that don’t fit into a row will move down to the next line.
  2. wrap-reverse — the same functionality as wrap, but the order of rows within a flex container is reversed
  3. nowrap — prevents items from wrapping; this is the default value and is only necessary to override a wrap value set by a different CSS rule.
239
Q

What does the align-items property do?

A

The align-items property controls how flex items are laid out along the cross axis on the current line. It is like the justify-content version for the cross-axis.

240
Q

What does the align-content property do?

A

The align-content property aligns a flex container’s lines within when there is extra space in the cross-axis, similar to how justify-content aligns individual items within the main-axis.

Note: Only works on multi-line flexible containers, where flex-wrap is set to either wrap or wrap-reverse.

241
Q

What are some common align-content values?

A

flex-start, flex-end, center, space-between, space-around, and stretch.

242
Q

What properties does the main axis use to position flex items?

A

justify-content
flex-wrap
flex-grow
flex-shrink

243
Q

What properties does the cross axis use to position flex items?

A

align-items
align-content

244
Q

What property do we use to switch the main axis and cross axis?

A

flex-direction property

245
Q

What is the default direction for flex-direction?

A

row

246
Q

What is the syntax for flex-direction?

A

.container {
display: flex;
flex-direction: column;
width: 1000px;
}

247
Q

What are the four values that flex-direction can accept?

A
  1. row — elements will be positioned from left to right across the parent element starting from the top left corner (default).
  2. row-reverse — elements will be positioned from right to left across the parent element starting from the top right corner.
  3. column — elements will be positioned from top to bottom of the parent element starting from the top left corner.
  4. column-reverse — elements will be positioned from the bottom to the top of the parent element starting from the bottom left corner
248
Q

What does the flex-flow property do?

A

the shorthand flex-flow property is used to declare both the flex-wrap and flex-direction properties in one line.

249
Q

How can flex containers be nested inside of each other?

A

We can nest flex containers into flex containers by declaring display: flex or display: inline-flex for children of flex containers.

250
Q

How can we select all of the direct children inside of an element?

A

We can combine the child combinator with the universal selector.

Example:

.container > * {
flex-basis: 100px;
}

251
Q

How does Flexbox prioritize the size of Flexbox items?

A

min/max width –> flex-basis–> width (element height or width) –> content width

252
Q

What is the default max-width and min-width that is set when using Flexbox?

A

The default max-width is all of the content lined up and the default min-width is the longest word in the content.

253
Q

What’s an easy way to set something (an element or flex container) to the middle of the screen?

A

Using Flexbox, setting justify-content to center setting align-items to center, and setting height to 100vh (vertical height).

254
Q

What is the difference between Flexbox and Grid?

A

Flexbox is a tool that helps you align content along a one dimensional line. Grid is a tool for laying out content along a two dimensional grid.

Many times you will use a combination of these two tools alongside floats or bootstrap.

255
Q

What is the syntax for creating a grid?

A

.container {
display: grid;
grid-template-columns: 1fr 2fr;
grid-template-rows: 1 fr 1fr;
gap: 10px;
}

256
Q

What does 1fr and 2fr mean when setting the value for the template columns and template rows property?

A

They are fractional ratios of 1: 2 and 1:1. Which means if the first column is 100px wide then the second column would be 200px wide. Or the rows would each be 100px long.

257
Q

How can we combine grid-template-columns and grid-template rows in one property?

A

We can use the grid-template property.

Example:
grid-template: 100px 200px/ 400px 800px;

Rows first and then columns

258
Q

What does the auto keyword do when being used as a property for grid?

A

The auto keyword allows each column to try to fit to 100% of the available space (horizontal space). Setting auto for rows will adjust the vertical height to be able to fit the content.

Example:
.container {
display: grid;
grid-template -rows: 100px auto;
grid-template-columns: 200px auto;

259
Q

How can we limit the size of columns within our grid?

A

We can use minmax value for our grid-template-column property.

Example
.grid-container {
display: grid;
grid-template-row: 200px 400px;
grid-template-column: 200px minmax(400px, 800px);
}

260
Q

How can we easily repeat a size when using grid columns and rows?

A

By using the repeat function.

Example:
grid-container {
display: grid;
grid-template-row: repeat(2, 200px);
grid-template-column: repeat(2, 100px);
}

repeat(2, 200px) = 200px 200px;

261
Q

What happens if you don’t define enough rows and columns for your elements?

A

Anything that gets added afterwards will get an automatic size based on its height and the existing column sizes.

262
Q

What happens if you define a grid that is larger than you have items for?

A

Our items are fitted into our grid from the top left all the way to the bottom right. Once we’ve laid out the first row, it’s going to double back and continue along the second row.
If we don’t have any items for the other sections of our grid then it’s just not going to add them in there.

263
Q

What does grid-auto-rows and grid-auto-columns do?

A

The grid-auto-rows/grid-auto-columns allows any new element that is added to the prefixed grid to be added with some value we determine. For example, creating some code that adds more divs in the future.

Example:
.grid-container {
display: grid
grid-template-columns: 200px 200px;
grid-template-rows: 200px 200px;
grid-auto-rows: 300px;
}

264
Q

What are tracks?

A

Tracks are what we call rows and columns in css grid. (row tracks and columns tracks)

265
Q

What is a grid cell?

A

A grid cells is what is created within the intersections of the tracks. It is the smallest unit in a grid. You can use multiple cells to create a grid item.

266
Q

What is the default height for a div? How can we make the height stretch down to the bottom of the window?

A

The default height for a grid is the amount of vertical space equal to the content. We can make the height stretch down to the bottom of the window by using 100 viewport height.

267
Q

How can we make a div span two or more columns in a grid?

A

By using the grid-column property and setting a value of span 2.

Example:
.cowboy {
background-color: blue;
grid-column: span 2;
}

268
Q

How can we make a div span two or more rows in a grid?

A

By using the grid-row property and setting a value of span 2.

Example:
.cowboy {
background-color: blue;
grid-row: span 2;
}

269
Q

grid-column is shorthand for what other two properties?

A

grid-column-start and grid-column-end

270
Q

How do the negative values work when using a grid-column-start and grid-column-end?

A

Negative values go in the opposite direction (right to left). The negative numbers are within the grid lines.

grid-column-start: -1; —> starts at the negative 1 grid line
grid-column-end: -3 ; –> ends at the negative 3 grid line.

271
Q

What’s a trick for always being able to specify the right hand most line in the grid and the left hand most line in the grid?

A

Using -1 for the right hand side of the grid and 1 for the left hand side of the grid.

272
Q

What is the default order for elements within a grid and how can we change the order?

A

The default order for elements in a grid is 0. We move an element to the end of the grid by giving it a any number larger than 0.

The direction goes left to right and top to bottom.

Syntax:
grid-area: 2/1/3/3;

273
Q

What does the grid-area property do?

A

The grid-area property specifies the area of the grid in which the element should be placed. It combines the grid-column-start, grid-column-end, grid-row-start, and grid-row-end.

274
Q

What is the order for the grid-area values?

A

1st - grid-row-start
2nd - grid -column-start
3rd -grid-row-end
4th - grid-column-end

275
Q

What’s really important to remember when using grid-area?

A

If you use the grid-area property for one item you must use the grid-area property for the rest of the items as well.

276
Q

What are two ways to color the grid lines?

A

Use the border color property and have a gap of 0. Make the background color what you prefer and create a gap that shows the background color.

Example (using border):
.white-box3 {
background-color: #F0F1EC;
grid-column: span 2;
grid-row: span 2;
border-right: solid 9px black;
border-bottom: solid 9px black;
}

Example (using background color):
.container {
height: 748px;
width: 748px;
display: grid;
background-color: #000;
grid-template-columns: 320px 198px 153px 50px;
grid-template-rows: 414px 130px 155px 22px;
gap: 9px;
}