CSS Flashcards

1
Q

Selectors

A

indicate which element the rule applies to. The same rule can apply to more than one element if you separate the element names with commas.

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

Declarations

A

Declarations indicate how
the elements referred to in the selector should be styled. Declarations are split into two parts (a property and a value), and are separated by a colon.

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

Link

A

link href=”css/example.css” type=”text/css”

rel=”stylesheet” />

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

unIverSaL SeLector

A

Applies to all elements in the document
* {}
Targets all elements on the page

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

type SeLector

A

h1, h2, h3 {}

Targets the <h1>, </h1><h2> and </h2><h3> elements</h3>

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

Class Selector

A
.note {}
Targets any element whose class attribute has a value of note p.note {}
Targets only <p> elements whose class attribute has a value of note</p>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Class Selector

A
.note {}
Targets any element whose class attribute has a value of note p.note {}
Targets only <p> elements whose class attribute has a value of note</p>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

ID selector

A
#introduction {}
Targets the element whose id attribute has a value of introduction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

child selector

A

li>a {}
Targets any <a> elements that are children of an </a><li><a> element (but not other </a><a> elements in the page)</a></li>

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

deScendant SeLector

A

p a {}

Targets any <a> elements that sit inside a <p> element, even if there are other elements nested between them</p></a>

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

adjacent SIBLIng SeLector

A

h1+p {}
Targets the first <p> element after any </p><h1> element (but not other </h1><p> elements)
</p>

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

generaL SIBLIng SeLector

A

h1~p {}

If you had two <p> elements that are siblings of an </p><h1> element, this rule would apply to both</h1>

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

• What are the names of the individual pieces of a CSS rule?

A

group of selectors -> declaration block

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

• In CSS, how do you select elements by their class attribute?

A

.notation

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

• In CSS, how do you select elements by their type?

A

Type Selectors correspond with HTML elements. ID Selectors are used by adding # in front of an elements ID. Class Selectors are used by adding a period in front of an elements class.

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

• In CSS, how do you select an element by its id attribute?

A

intro

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

Property: Value;

A

The property which is an identifier, that is a human-readable name, that defines which feature is considered.
The value which describe how the feature must be handled by the engine. Each property has a set of valid values, defined by a formal grammar, as well as a semantic meaning, implemented by the browser engine.

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

CSS rule (rule set)

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

CSS Summary

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

block Box model

A

If a box has an outer display type of block, it will behave in the following ways:

The box will break onto a new line.
The box will extend in the inline direction to fill the space available in its container. In most cases this means that the box will become as wide as its container, filling up 100% of the space available.
The width and height properties are respected.
Padding, margin and border will cause other elements to be pushed away from the box.
Some HTML elements, such as <h1> and </h1><p>, use block as their outer display type by default.</p>

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

Inline box

A

If a box has an outer display type of inline, then:

The box will not break onto a new line.
The width and height properties will not apply.
Vertical padding, margins, and borders will apply but will not cause other inline boxes to move away from the box.
Horizontal padding, margins, and borders will apply and will cause other inline boxes to move away from the box.
Some HTML elements, such as <a>, <span>, <em> and <strong> use inline as their outer display type by default.</strong></em></span></a>

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

What is the default flex-direction of a flex container?

A

The default flex-direction of a flex container is row,

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

• What is the default flex-wrap of a flex container?

A

nowrap (default): all flex items will be on one line

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

• How does setting position: relative on an element affect document flow?

A

Normal document flow, if you just put the position relative without any box offset properties

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

• How does setting position: relative on an element affect where it appears on the page?

A

It moves from the place where it is normal in document flow

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

• How does setting position: absolute on an element affect document flow?

A

Can block out other boxes? Sibling elements will side into place and it doesn’t exist anymore in document flow, its ripped out and you can move it wherever

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

x, y, z index

A

x axis, y axis, z-index makes things three dimensional aka what element will be over something else. or like a gray background

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

• Name three different types of values you can use to specify colors in CSS.

A

• RGB values, hex codes, color names, HSL, Alpha channel

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

What are the four components of “the Cascade”.

A

source order, inheritance, specificity and !important

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

• What does the term “source order” mean with respect to CSS?

A

However, it is common in CSS development to declare styling for an element on the same property multiple times throughout your stylesheet. For instance, given the following HTML:

<h1>Some News Headline</h1>

And the following CSS:

.news-headline {
font-size: 60px;
}

.medium-text {
font-size: 25px;
}
Both the news-headline and medium-text classes include a font-size property. So which style ultimately gets applied?

The last element

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

• What does the term “source order” mean with respect to CSS?

A

You can force a lot of properties to inherit values from their parent elements by using inherit for the value of the properties. In this example, the <div> element with a class called page inherits the padding size from the CSS rule that applies to the element.</div>

32
Q

CSS properties can be categorized in two types:

A

inherited properties, which by default are set to the computed value of the parent element
non-inherited properties, which by default are set to initial value of the property

p { color: green; }
Copy to Clipboard
… and the markup:

<p>This paragraph has <em>emphasized text</em> in it.</p>

When no value for a non-inherited property has been specified on an element, the element gets the initial value of that property (as specified in the property’s summary).

A typical example of a non-inherited property is the border property. Given the style rules:

p { border: medium solid; }
Copy to Clipboard
… and the markup:

<p>This paragraph has <em>emphasized text</em> in it.</p>

You can control inheritance for all properties at once using the all shorthand property, which applies its value to all properties. For example:

p {
  all: revert;
  font-size: 200%;
  font-weight: bold;
}
33
Q

specificity

A
Specificity
Specificity is the means by which browsers decide which CSS property values are the most relevant to an element and, therefore, will be applied. Specificity is based on the matching rules which are composed of different sorts of CSS selectors.
Type selectors (e.g., h1) and pseudo-elements (e.g., ::before).
Class selectors (e.g., .example), attributes selectors (e.g., [type="radio"]) and pseudo-classes (e.g., :hover).
ID selectors (e.g., #example).
Type selectors (e.g., h1) and pseudo-elements (e.g., ::before).
Class selectors (e.g., .example), attributes selectors (e.g., [type="radio"]) and pseudo-classes (e.g., :hover).
ID selectors (e.g., #example).
34
Q

• List the three selector types in order of increasing specificity.

A
element
.class
#id
!important
Type selectors (e.g., h1) and pseudo-elements (e.g., ::before).
Class selectors (e.g., .example), attributes selectors (e.g., [type="radio"]) and pseudo-classes (e.g., :hover).
ID selectors (e.g., #example).
35
Q

• Why is using !important considered bad practice?

A

Using !important, however, is bad practice and should be avoided because it makes debugging more difficult by breaking the natural cascading in your stylesheets. When two conflicting declarations with the !important rule are applied to the same element, the declaration with a greater specificity will be applied.

36
Q

Use CSS Variables to change several elements at once
CSS Variables are a powerful way to change many CSS style properties at once by changing only one value.

Follow the instructions below to see how changing just three values can change the styling of many elements.

In the penguin class, change the black value to gray, the gray value to white, and the yellow value to orange.
When using your variable as a CSS property value, you can attach a fallback value that your browser will revert to if the given variable is invalid.

Note: This fallback is not used to increase browser compatibility, and it will not work on IE browsers. Rather, it is used so that the browser has a color to display if it cannot find your variable.

Here’s how you do it:

background: var(–penguin-skin, black);
This will set background to black if your variable wasn’t set. Note that this can be useful for debugging.

A

.penguin {

    /* Only change code below this line */
    --penguin-skin: black;
    --penguin-belly: gray;
    --penguin-beak: yellow;
    /* Only change code above this line */
.penguin-top {
    top: 10%;
    left: 25%;
    background: var(--penguin-skin, gray);
    width: 50%;
    height: 45%;
    border-radius: 70% 70% 60% 60%;
  }
37
Q

fall-back property using var(–penguin-skin, black)

A
38
Q

Change a variable for a specific area

A

When you create your variables in :root they will set the value of that variable for the whole page.

You can then overwrite these variables by setting them again within a specific selector.

Change the value of –penguin-belly to white in the penguin class.

39
Q

Use a media query to change a variable
CSS Variables can simplify the way you use media queries.

For instance, when your screen is smaller or larger than your media query break point, you can change the value of a variable, and it will apply its style wherever it is used.

A
@media (max-width: 350px) {
    :root {
      /* Only change code below this line */
      /* Only change code above this line */
    }
  }
40
Q

Create Visual Balance Using the text-align Property

A

Text is often a large part of web content. CSS has several options for how to align it with the text-align property.

text-align: justify; spaces the text so that each line has equal width.

text-align: center; centers the text

text-align: right; right-aligns the text

And text-align: left; (the default) left-aligns the text.

41
Q

<strong></strong> bold
<u></u> underline
<em> italics
strike through</em>

A

Use the strong Tag to Make Text Bold
To make text bold, you can use the strong tag. This is often used to draw attention to text and symbolize that it is important. With the strong tag, the browser applies the CSS of font-weight: bold; to the element.
To strikethrough text, which is when a horizontal line cuts across the characters, you can use the s tag. It shows that a section of text is no longer valid. With the s tag, the browser applies the CSS of text-decoration: line-through; to the element.

42
Q

<hr></hr>

A

Create a Horizontal Line Using the hr Element
You can use the hr tag to add a horizontal line across the width of its containing element. This can be used to define a change in topic or to visually separate groups of content.
Add an hr tag underneath the h4 which contains the card title.

Note: In HTML, hr is a self-closing tag, and therefore doesn’t need a separate closing tag.
Add an hr tag underneath the h4 which contains the card title.

Note: In HTML, hr is a self-closing tag, and therefore doesn’t need a separate closing tag.

43
Q
rgba stands for:
  r = red
  g = green
  b = blue
  a = alpha/level of opacity
A
44
Q

Box Shadow

A

The box-shadow property takes the following values, in order:

offset-x (how far to push the shadow horizontally from the element)
offset-y (how far to push the shadow vertically from the element)
blur-radius
spread-radius
color
The blur-radius and spread-radius values are optional.
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);

45
Q

Decrease the Opacity of an Element

A

The opacity property in CSS is used to adjust the opacity, or conversely, the transparency for an item.

A value of 1 is opaque, which isn’t transparent at all.
A value of 0.5 is half see-through.
A value of 0 is completely transparent.
The value given will apply to the entire element, whether that’s an image with some transparency, or the foreground and background colors for a block of text.
Opacity: 0.7;

46
Q

Use the text-transform Property to Make Text Uppercase

A

The text-transform property in CSS is used to change the appearance of text. It’s a convenient way to make sure text on a webpage appears consistently, without having to change the text content of the actual HTML elements.

The following table shows how the different text-transformvalues change the example text "Transform me".
Value	Result
lowercase	"transform me"
uppercase	"TRANSFORM ME"
capitalize	"Transform Me"
initial	Use the default value
inherit	Use the text-transform value from the parent element
none	Default: Use the original text
46
Q

Use the text-transform Property to Make Text Uppercase

A

The text-transform property in CSS is used to change the appearance of text. It’s a convenient way to make sure text on a webpage appears consistently, without having to change the text content of the actual HTML elements.

The following table shows how the different text-transformvalues change the example text "Transform me".
Value	Result
lowercase	"transform me"
uppercase	"TRANSFORM ME"
capitalize	"Transform Me"
initial	Use the default value
inherit	Use the text-transform value from the parent element
none	Default: Use the original text
47
Q

font-weight:

A

You set the font-size of each heading tag in the last challenge, here you’ll adjust the font-weight.

The font-weight property sets how thick or thin characters are in a section of text.

47
Q

font-weight:

A

You set the font-size of each heading tag in the last challenge, here you’ll adjust the font-weight.

The font-weight property sets how thick or thin characters are in a section of text.

48
Q

Set the line-height of Paragraphs

A

CSS offers the line-height property to change the height of each line in a block of text. As the name suggests, it changes the amount of vertical space that each line of text gets.

Add a line-height property to the p tag and set it to 25px.

49
Q

a:hover {

A

This challenge will touch on the usage of pseudo-classes. A pseudo-class is a keyword that can be added to selectors, in order to select a specific state of the element.

For example, the styling of an anchor tag can be changed for its hover state using the :hover pseudo-class selector. Here’s the CSS to change the color of the anchor tag to red during its hover state:

a {
color: #000;
}

a:hover {
color: blue;
}

50
Q

Change an Element’s Relative Position

A

CSS treats each HTML element as its own box, which is usually referred to as the CSS Box Model. Block-level items automatically start on a new line (think headings, paragraphs, and divs) while inline items sit within surrounding content (like images or spans). The default layout of elements in this way is called the normal flow of a document, but CSS offers the position property to override it.
When the position of an element is set to relative, it allows you to specify how CSS should move it relative to its current position in the normal flow of the page. It pairs with the CSS offset properties of left or right, and top or bottom. These say how many pixels, percentages, or ems to move the item away from where it is normally positioned. The following example moves the paragraph 10 pixels away from the bottom:

DOES NOT CHANGE NORMAL FLOW
Change the position of the h2 to relative, and use a CSS offset to move it 15 pixels away from the top of where it sits in the normal flow. Notice there is no impact on the positions of the surrounding h1 and p elements.

51
Q

Move a Relatively Positioned Element with CSS Offsets

A

The CSS offsets of top or bottom, and left or right tell the browser how far to offset an item relative to where it would sit in the normal flow of the document. You’re offsetting an element away from a given spot, which moves the element away from the referenced side (effectively, the opposite direction).

52
Q

Position Absolute:

A

The next option for the CSS position property is absolute, which locks the element in place relative to its parent container. Unlike the relative position, this removes the element from the normal flow of the document, so surrounding items ignore it. The CSS offset properties (top or bottom and left or right) are used to adjust the position.

One nuance with absolute positioning is that it will be locked relative to its closest positioned ancestor. If you forget to add a position rule to the parent item, (this is typically done using position: relative;), the browser will keep looking up the chain and ultimately default to the body tag.
if you put top: that means away from top, bottom means away from bottom

52
Q

Position Absolute:

A

The next option for the CSS position property is absolute, which locks the element in place relative to its parent container. Unlike the relative position, this removes the element from the normal flow of the document, so surrounding items ignore it. The CSS offset properties (top or bottom and left or right) are used to adjust the position.

One nuance with absolute positioning is that it will be locked relative to its closest positioned ancestor. If you forget to add a position rule to the parent item, (this is typically done using position: relative;), the browser will keep looking up the chain and ultimately default to the body tag.
if you put top: that means away from top, bottom means away from bottom

53
Q

Push Elements Left or Right with the float Property

A

The next positioning tool does not actually use position, but sets the float property of an element. Floating elements are removed from the normal flow of a document and pushed to either the left or right of their containing parent element. It’s commonly used with the width property to specify how much horizontal space the floated element requires.

    #left {
      float: left;
      width: 50%;
    }
    #right {
      float: right;
      width: 40%;
    }
    aside, section {
      padding: 2px;
      background-color: #ccc;
    }
good for 2 column
54
Q

Z index

A

When elements are positioned to overlap (i.e. using position: absolute | relative | fixed | sticky), the element coming later in the HTML markup will, by default, appear on the top of the other elements. However, the z-index property can specify the order of how elements are stacked on top of one another. It must be an integer (i.e. a whole number and not a decimal), and higher values for the z-index property of an element move it higher in the stack than those with lower values.
z-index: 2

54
Q

Z index

A

When elements are positioned to overlap (i.e. using position: absolute | relative | fixed | sticky), the element coming later in the HTML markup will, by default, appear on the top of the other elements. However, the z-index property can specify the order of how elements are stacked on top of one another. It must be an integer (i.e. a whole number and not a decimal), and higher values for the z-index property of an element move it higher in the stack than those with lower values.
z-index: 2

55
Q

Another positioning technique is to center a block element horizontally. One way to do this is to set its margin to a value of auto.

A
This method works for images, too. Images are inline elements by default, but can be changed to block elements when you set the display property to block.
 div {
    background-color: blue;
    height: 100px;
    width: 100px;
    margin: auto;

}

55
Q

Another positioning technique is to center a block element horizontally. One way to do this is to set its margin to a value of auto.

A
This method works for images, too. Images are inline elements by default, but can be changed to block elements when you set the display property to block.
 div {
    background-color: blue;
    height: 100px;
    width: 100px;
    margin: auto;

}

56
Q

hsl()

A

Colors have several characteristics including hue, saturation, and lightness. CSS3 introduced the hsl() function as an alternative way to pick a color by directly stating these characteristics.
In hsl(), hue uses a color wheel concept instead of the spectrum, where the angle of the color on the circle is given as a value between 0 and 360.
Saturation is the amount of gray in a color. A fully saturated color has no gray in it, and a minimally saturated color is almost completely gray. This is given as a percentage with 100% being fully saturated.
Lightness is the amount of white or black in a color. A percentage is given ranging from 0% (black) to 100% (white), where 50% is the normal color.
Color HSL
red hsl(0, 100%, 50%)
yellow hsl(60, 100%, 50%)
green hsl(120, 100%, 50%). –
cyan hsl(180, 100%, 50%)
blue hsl(240, 100%, 50%)
magenta hsl(300, 100%, 50%)

57
Q

ajust tone of color with hsl()

A

The hsl() option in CSS also makes it easy to adjust the tone of a color. Mixing white with a pure hue creates a tint of that color, and adding black will make a shade. Alternatively, a tone is produced by adding gray or by both tinting and shading. Recall that the ‘s’ and ‘l’ of hsl() stand for saturation and lightness, respectively. The saturation percent changes the amount of gray and the lightness percent determines how much white or black is in the color. This is useful when you have a base hue you like, but need different variations of it.

All elements have a default background-color of transparent. Our nav element currently appears to have a cyan background, because the element behind it has a background-color set to cyan. Add a background-color to the nav element so it uses the same cyan hue, but has 80% saturation and 25% lightness values to change its tone and shade.

57
Q

ajust tone of color with hsl()

A

The hsl() option in CSS also makes it easy to adjust the tone of a color. Mixing white with a pure hue creates a tint of that color, and adding black will make a shade. Alternatively, a tone is produced by adding gray or by both tinting and shading. Recall that the ‘s’ and ‘l’ of hsl() stand for saturation and lightness, respectively. The saturation percent changes the amount of gray and the lightness percent determines how much white or black is in the color. This is useful when you have a base hue you like, but need different variations of it.

All elements have a default background-color of transparent. Our nav element currently appears to have a cyan background, because the element behind it has a background-color set to cyan. Add a background-color to the nav element so it uses the same cyan hue, but has 80% saturation and 25% lightness values to change its tone and shade.

58
Q

Linear background gradient

A

background: linear-gradient(90deg, red, yellow, rgb(204, 204, 255));
The first argument specifies the direction from which color transition starts - it can be stated as a degree, where 90deg makes a horizontal gradient (from left to right) and 45deg makes a diagonal gradient (from bottom left to top right). The following arguments specify the order of colors used in the gradient.

58
Q

Linear background gradient

A

background: linear-gradient(90deg, red, yellow, rgb(204, 204, 255));
The first argument specifies the direction from which color transition starts - it can be stated as a degree, where 90deg makes a horizontal gradient (from left to right) and 45deg makes a diagonal gradient (from bottom left to top right). The following arguments specify the order of colors used in the gradient.

59
Q

REPEATING LINERAR gradient

A

The repeating-linear-gradient() function is very similar to linear-gradient() with the major difference that it repeats the specified gradient pattern. repeating-linear-gradient() accepts a variety of values, but for simplicity, you’ll work with an angle value and color stop values in this challenge.

The angle value is the direction of the gradient. Color stops are like width values that mark where a transition takes place, and are given with a percentage or a number of pixels.
 div{
    border-radius: 20px;
    width: 70%;
    height: 400px;
    margin:  50 auto;
    background: repeating-linear-gradient(
      45deg,
      yellow 0px,
      yellow 40px,
      black 40px,
      black 80px
    );
  }
59
Q

REPEATING LINERAR gradient

A

The repeating-linear-gradient() function is very similar to linear-gradient() with the major difference that it repeats the specified gradient pattern. repeating-linear-gradient() accepts a variety of values, but for simplicity, you’ll work with an angle value and color stop values in this challenge.

The angle value is the direction of the gradient. Color stops are like width values that mark where a transition takes place, and are given with a percentage or a number of pixels.
 div{
    border-radius: 20px;
    width: 70%;
    height: 400px;
    margin:  50 auto;
    background: repeating-linear-gradient(
      45deg,
      yellow 0px,
      yellow 40px,
      black 40px,
      black 80px
    );
  }
60
Q

Create Texture by Adding a Subtle Pattern as a Background Image

A

One way to add texture and interest to a background and have it stand out more is to add a subtle pattern. The key is balance, as you don’t want the background to stand out too much, and take away from the foreground. The background property supports the url() function in order to link to an image of the chosen texture or pattern. The link address is wrapped in quotes inside the parentheses.
body {
background: url(https://cdn-media-1.freecodecamp.org/imgr/MJAkxbh.png)

}

61
Q

Use the CSS Transform scale Property to Change the Size of an Element

A

p {
transform: scale(2);
}

62
Q

Use the CSS Transform scale Property to Scale an Element on Hover

A

p:hover {
transform: scale(2.1);
}

62
Q

Use the CSS Transform scale Property to Scale an Element on Hover

A

p:hover {
transform: scale(2.1);
}

63
Q

Use the CSS Transform Property skewX to Skew an Element Along the X-Axis

A

The next function of the transform property is skewX(), which skews the selected element along its X (horizontal) axis by a given degree.
The following code skews the paragraph element by -32 degrees along the X-axis.

p {
transform: skewX(-32deg);
}

64
Q

Create a Graphic Using CSS

A

You may recall from an earlier challenge that the box-shadow property takes values for offset-x, offset-y, blur-radius, spread-radius and a color value in that order. The blur-radius and spread-radius values are optional.

Manipulate the square element in the editor to create the moon shape. First, change the background-color to transparent, then set the border-radius property to 50% to make the circular shape. Finally, change the box-shadow property to set the offset-x to 25px, the offset-y to 10px, blur-radius to 0, spread-radius to 0, and color to blue.
.center {
    position: absolute;
    margin: auto;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100px;
    height: 100px;
    background-color: transparent;
    border-radius: 50%;
    box-shadow: 25px 10px 0 0 blue;
  }
65
Q

heart::before
heart::after;
Create a More Complex Shape Using CSS and HTML

A
One of the most popular shapes in the world is the heart shape, and in this challenge you'll create one using pure CSS. But first, you need to understand the ::before and ::after pseudo-elements. ::before creates a pseudo-element that is the first child of the selected element; ::after creates a pseudo-element that is the last child of the selected element. In the following example, a ::before pseudo-element is used to add a rectangle to an element with the class heart:
 .heart {
    position: absolute;
    margin: auto;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: pink;
    height: 50px;
    width: 50px;
    transform: rotate(-45deg);
  }
  .heart::after {
    background-color: pink;
    content: "";
    border-radius: 50%;
    position: absolute;
    width: 50px;
    height: 50px;
    top: 0px;
    left: 25px;
  }
  .heart::before {
    content: ""; // this was empty before, added the "" after
    background-color: pink;
    border-radius: 50%;
    position: absolute;
    width: 50px;
    height: 50px;
    top: -25px;
    left: 0px;
  }
66
Q

Background position: bottom

same with top right and left

A

If this is on an image, it will show the bottom part of the picture
AKA example

67
Q

background position: center / cover

A

oftrn u have to put cover after the position