Free Practice Quiz Question List

3 CSS Styling and Layout Online Quiz Questions

Use this free practice quiz with 20 questions to review 3 CSS Styling and Layout, test your knowledge, and prepare for your next test or exam.

20 questions
01
True or false
1 point

True or false: A web page can remain readable even when it has no author stylesheet because browsers apply default styles.

  1. A

    True

  2. B

    False

02
Choose one
1 point

Which element does the CSS selector #main target?

  1. A

    Every element with the class main

  2. B

    The element with ID main

  3. C

    Every <main> element

  4. D

    Every paragraph inside an element with ID main

03
Fill in the blank
1 point

A comma-separated group such as h1, h2 that applies the same declarations to each match is called a selector .

04
Written response
1 point

In the typography example, what numeric value is assigned to body's line-height? Enter the number only.

05
Choose one
1 point

Which CSS property should you use to provide a fallback font stack if your first-choice font is unavailable?

  1. A

    font-style

  2. B

    font-weight

  3. C

    font-family

  4. D

    line-height

06
True or false
1 point

True or false: In normal flow, block boxes such as paragraphs usually start on a new line and take the available width.

  1. A

    True

  2. B

    False

07
Fill in the blank
1 point

In the CSS box model, the region that creates space outside an element's border is the .

08
Choose all
1 point

Select all the properties that normally inherit their values from an element's parent.

  1. A

    color normally inherits from a parent.

  2. B

    margin normally inherits from a parent.

  3. C

    font-family normally inherits from a parent.

  4. D

    border normally inherits from a parent.

09
Choose one
1 point

Which CSS property controls the alignment of text?

  1. A

    font-weight

  2. B

    text-align

  3. C

    font-family

  4. D

    font-style

10
Choose all
1 point

Select all the correct statements about Grid and responsive layout.

  1. A

    Grid arranges items in rows and columns.

  2. B

    Grid is designed only for one-dimensional toolbars.

  3. C

    Responsive layout can use flexible sizing and media queries to adapt to available space and screen sizes.

  4. D

    Responsive layout prevents content from adapting to different screen sizes.

11
Written response
1 point

What CSS selector targets paragraphs inside an <article> element? Enter the selector exactly.

12
Choose one
1 point

A grid uses grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)). What happens to the number of columns when the available screen width becomes narrower?

  1. A

    The grid always keeps the same number of columns, regardless of screen width.

  2. B

    The grid forces every column to become narrower than 14rem.

  3. C

    Fewer columns fit on narrower screens.

  4. D

    The grid changes into a Flexbox layout.

13
Open ended
1 point

Consider the CSS rules p { color: #333; } and article p { color: #145a32; }. What color does a paragraph inside an <article> use, and why?

14
Choose one
1 point

You want one CSS rule to target every element assigned the notice class, regardless of element type. Which selector should you use?

  1. A

    #notice

  2. B

    .notice

  3. C

    notice

  4. D

    article notice

15
True or false
1 point

In normal flow, a paragraph displayed as a block usually starts on a new line and takes the available width.

  1. A

    True

  2. B

    False

16
Choose one
1 point

A page's background is already correct, but its text needs a different foreground color. Which CSS property should you change?

  1. A

    background-color

  2. B

    font-color

  3. C

    color

  4. D

    text-background

17
Choose one
1 point

A navigation bar needs its items aligned across a row. Which CSS layout system is a suitable choice for arranging and aligning those items along one axis?

  1. A

    Flexbox

  2. B

    Grid

  3. C

    Normal flow only

  4. D

    The box model

18
Choose one
1 point

A page section contains a collection of cards that should be arranged in both rows and columns. Which layout system best matches that two-dimensional structure?

  1. A

    Flexbox

  2. B

    A type selector

  3. C

    Normal flow

  4. D

    Grid

19
Written response
1 point

You want a text block's line spacing to scale with its text size, using a unitless value such as 1.5. Which CSS property should you set?

20
Written response
1 point

A design specifies a preferred font that may not be installed on every device. What should the font-family declaration include so the browser can use another available font?