Free Online Flashcard Deck

3 CSS Styling and Layout Free Online FlashCards

Study 3 CSS Styling and Layout with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.

12 cards
01
Front

What does CSS control?

Back

CSS controls how HTML content looks and how its boxes are arranged.

02
Front

What are the parts of a CSS rule?

Back

A rule contains a selector and one or more declarations. Each declaration pairs a property with a value.

03
Front

What does the selector `article p` match?

Back

`article p` matches paragraph elements that are inside an `<article>` element.

04
Front

How do class and ID selectors differ in purpose?

Back

A class selector such as `.notice` can style multiple elements; an ID selector such as `#main` targets an element identified by that ID.

05
Front

How does specificity rank ID, class, and type selectors?

Back

In ordinary author CSS, an ID selector has greater specificity than a class selector, which has greater specificity than a type selector. If tied declarations otherwise remain equal, the later one wins.

06
Front

How does CSS inheritance work?

Back

Properties such as `color` and `font-family` normally inherit from a parent; `margin` and `border` generally do not. A declaration directly targeting an element takes precedence over an inherited value.

07
Front

Why provide a fallback font stack?

Back

A fallback font stack lets the browser use another available font if the first choice is unavailable.

08
Front

What is a benefit of unitless `line-height`?

Back

A unitless `line-height`, such as `1.5`, scales with the text size and helps provide consistent line spacing.

09
Front

What do `color` and `background-color` set?

Back

`color` sets an element’s foreground color, usually its text; `background-color` sets its background. Keep enough contrast for text to remain readable.

10
Front

What is the order of the box model layers, inside to outside?

Back

From inside to outside, a CSS box consists of content, padding, border, and margin.

11
Front

What does `box-sizing: border-box` include in an element’s width?

Back

With `box-sizing: border-box`, declared width and height include padding and border. Margins remain outside those dimensions.

12
Front

How do block boxes and inline content behave in normal flow?

Back

In normal flow, block boxes usually start on a new line and take the available width. Inline content flows within a line and wraps when needed.