CSS Styling and Layout Flashcards (57 cards)

All cards

1Question

What does CSS describe in a document?

Answer

The document’s style.

2Question

What three ways can CSS be included in an HTML document?

Answer

Inline on an element, in a `<style>` element, or in an external stylesheet.

3Question

Which symbol represents the universal CSS selector?

Answer

*

4Question

Which CSS selector form targets an element type such as `h1`?

Answer

An element selector.

5Question

Which CSS selector form uses an identifier such as `#myId`?

Answer

An ID selector.

6Question

Which CSS selector form uses a class such as `.myClass`?

Answer

A class selector.

7Question

What does the CSS `color` property set?

Answer

Foreground color.

8Question

What does CSS `text-align` align text within?

Answer

Its parent element.

9Question

What does `right` mean for CSS `text-align`?

Answer

The parent element’s right side.

10Question

What numeric range can CSS `font-weight` use?

Answer

100 to 900.

11Question

Which four areas make up the CSS box model?

Answer

Content, padding, border, and margin.

12Question

By default, what area do an element’s `height` and `width` dimensions set?

Answer

The content area.

13Question

What width does `display: block` take?

Answer

The available width.

14Question

What happens to document flow when `display: none` hides an element?

Answer

The element is removed from the flow without reserving space.

15Question

What dimension usually determines the reference for a percentage width on an element?

Answer

The corresponding dimension of its parent element.

16Question

For an element's font size, what does `em` refer to?

Answer

The parent element's font size.

17Question

What does the CSS `position` property determine?

Answer

How an element is positioned in a document.

18Question

Which positioning mode ignores top, right, bottom, left, and z-index?

Answer

`static`.

19Question

Which positioning mode uses the closest positioned ancestor and removes the element from flow?

Answer

`absolute`.

20Question

What kind of layout method is Flexbox?

Answer

A one-dimensional layout method for arranging items in rows or columns.

21Question

What display value enables the flex model on a container?

Answer

flex

22Question

Which property aligns flex items along the main axis?

Answer

justify-content

23Question

What conditions can a CSS media query use to apply responsive styles?

Answer

Conditions such as viewport width or orientation.

24Question

What does a CSS transition define?

Answer

How an element changes between two states over time.

25Question

What does the CSS `transform` property apply to an element?

Answer

Two-dimensional or three-dimensional transformations.

26Question

What do CSS animations use to animate elements?

Answer

Keyframes and animation properties.

27Question

Which style takes precedence over external and internal styles?

Answer

An inline style.

28Question

What does a CSS selector identify?

Answer

The element or elements to which a CSS rule applies.

29Question

How can CSS colors be represented using RGB values?

Answer

With values such as `rgb(255, 0, 0)`.

30Question

How can CSS colors be represented using hexadecimal values?

Answer

With values such as `#ff0000`.

31Question

Which line styles can CSS `text-decoration` apply?

Answer

Underline, overline, and line-through.

32Question

Which CSS property value removes text decoration, including hyperlink decoration?

Answer

`none`.

33Question

How can CSS `font-family` specify fallback choices?

Answer

By listing multiple font families.

34Question

What does CSS `line-height` set?

Answer

Line spacing.

35Question

Which values does CSS `text-transform` support?

Answer

`uppercase`, `lowercase`, `capitalize`, and `none`.

36Question

Which properties can specify a CSS border separately?

Answer

`border-width`, `border-style`, and `border-color`.

37Question

What does `border-radius` round on an element?

Answer

Its outer border edge.

38Question

In what order does a four-value `padding` shorthand specify sides?

Answer

Top, right, bottom, left.

39Question

What does the alpha channel control in an RGBA color?

Answer

Opacity from 0 to 1.

40Question

What does `vh` measure relative to?

Answer

One percent of the viewport height.

41Question

What determines an element's `sticky` positioning?

Answer

The user's scroll position.

42Question

What determines an element’s stack level in CSS?

Answer

The `z-index` value.

43Question

Which property determines the axis and direction of flex items?

Answer

flex-direction

44Question

What is the default value of flex-direction?

Answer

row

45Question

Which property aligns an individual item along the cross axis?

Answer

align-self

46Question

What does a flex-grow value of 0 mean?

Answer

The item does not grow.

47Question

Which properties determine how much flex items grow or shrink relative to others?

Answer

flex-grow and flex-shrink

48Question

What two width conditions can a CSS media query test?

Answer

An exact width or a minimum width.

49Question

Which four properties configure CSS transitions?

Answer

`transition-property`, `transition-duration`, `transition-timing-function`, and `transition-delay`.

50Question

What is the CSS transition shorthand example?

Answer

`transition: font-size 2s ease-in-out 0.2s`.

51Question

In what order does the transition shorthand example list its values?

Answer

Property, duration, timing function, and delay.

52Question

Which CSS function rotates an element by 45 degrees?

Answer

`rotate(45deg)`.

53Question

Which CSS function scales an element?

Answer

`scale`.

54Question

Which CSS function skews an element by 30 degrees?

Answer

`skew(30deg)`.

55Question

Which markers can a CSS keyframes rule use to define animation states?

Answer

The `from` and `to` keywords or percentage points.

56Question

Which property sets a CSS animation’s duration?

Answer

`animation-duration`.

57Question

What is the CSS animation shorthand example?

Answer

`animation: myName 2s linear 3s infinite normal`.

Test yourself with the quiz

Answer 23 questions on CSS Styling and Layout.

1. What is the primary role of CSS in a web document?

2. A developer wants to place CSS rules in the same HTML document but separate from the elements they style. Where should the rules go?

Take the quiz →

Read the study guide

Go over the full study guide for CSS Styling and Layout.

Read the study guide →

Related classes

Make your own flashcards

Upload your class notes and Revizly writes your flashcards in about a minute.

Flashcard maker