CSS Flashcards Preview

Web Development > CSS > Flashcards

Flashcards in CSS Deck (34)
Loading flashcards...
1

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

Selector, Property, and Value.

2

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

.classname {

}

3

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

nameofelement {

}

4

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

#nameofid {

}

5

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

RGBA CSS Function, Hex Codes, and Color Names.

6

What CSS properties make up the box model?

Border, Padding, and Margin.

7

Which CSS property pushes boxes away from each other?

The Margin property pushes boxes away from each other.

8

Which CSS property add space between a box's content and its border?

The Padding property adds space between a box's content and its border.

9

What is a pseudo-class?

Pseudo-class is a keyword added to a selector that specifies a special state of the selected element.

10

What are CSS pseudo-classes useful for?

To apply CSS for a special state of the element that is implied by the browser.

Ex: :hover
:nth-child(odd)

11

Name at least two units of type size in CSS.

Pixels, Percentages, and Ems.

12

What CSS property controls the font used for the text inside an element?

The font-family property controls the font used for the text inside an element.

13

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

row is the default flex-direction of a flex container.

14

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

nowrap is the default flex-wrap of a flex container.

15

Why do two <div> elements "vertically stack" on one another by default?

Two <div> elements "vertically stack" on one another because they are block-level elements by default.

16

What is the default flex-direction of an element with display: flex?

The default flex-direction of an element with display: flex is row.

17

What is the default value for the position property of HTML elements?

Static is the default value for the position property of HTML elements.

18

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

Setting position: relative on an element does not affect the document flow.

19

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

Setting position: relative on an element does not affect where it appears on the page unless an offset value is given.

20

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

Setting position: absolute on an element removes that element from the normal flow of documents.

21

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

Setting position: absolute on an element moves that element to its own layer, and can be moved around with offset values.

22

How do you constrain an absolutely positioned element to a containing block?

You can constrain an absolutely positioned element to a containing block by using offset values.

23

What are the four box offset properties?

The four box offset properties are: top, bottom, left, and right.

24

What are the four components of "the Cascade".

Source order, Inheritance, Specificity, and !important.

25

What does the term "source order" mean with respect to CSS?

The order of the selectors in your stylesheet.

Lower css rules take precedence over higher css rules.

26

How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?

When an inherited property is used on the parent element, and a property isn't declared on the child.

27

What does the transform property do?

The transform CSS property lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the CSS visual formatting model.

28

Give four examples of CSS transform functions.

transform: matrix (1, 2, 3, 4, 5, 6)
transform: translate(120px, 50%)
transform: scale(2, 0.5)
transform: rotate(0.5 turn)
transform: skew(30deg, 20deg)

29

The transition property is shorthand for which four CSS properties?

transition-delay
transition-duration
transition-property
transition-timing-function

30

Give two examples of media features that you can query in an @media rule.

min-width
max-width
height
width
orientation
etc.