31. CSS Quiz

Test yourself

Choose an answer for each question. You get feedback straight away, and your best score is saved on this device.

What does CSS stand for?

  • Computer Style Sheets
  • Cascading Style Sheets
  • Creative Style System
  • Colorful Style Sheets

Which selector chooses elements with class="note"?

  • #note
  • note
  • .note
  • *note

Which is the best way to add CSS to a real website?

  • An external stylesheet linked with <link>
  • Inline style attributes on every element
  • Inside the <body> without tags
  • In an HTML comment

In the box model, which layer is outside the border?

  • Content
  • Padding
  • Border
  • Margin

What does box-sizing: border-box do?

  • Removes the border
  • Includes padding and border in the width and height
  • Adds a margin around the box
  • Makes the box round

Which unit is relative to the root font size?

  • px
  • vh
  • rem
  • pt

What is the correct order of link rules?

  • link, visited, hover, active
  • hover, link, active, visited
  • active, hover, visited, link
  • visited, link, active, hover

Which rule centres a block with a fixed width horizontally?

  • text-align: center;
  • margin: 0 auto;
  • padding: auto;
  • float: center;

Which property turns an element into a flex container?

  • position: flex
  • flex: container
  • layout: flex
  • display: flex

Which value makes a grid with as many 150px-or-wider columns as will fit?

  • repeat(auto-fit, minmax(150px, 1fr))
  • 150px 150px 150px
  • auto 150px
  • fit(150px)

How does a CSS variable name begin, and how do you read it?

  • With $, read with get()
  • With @, read with use()
  • With --, read with var()
  • With #, read with value()

Which approach is “mobile first”?

  • Hide everything on phones
  • Write small-screen styles first, then use min-width queries
  • Only test on a phone
  • Use max-width queries for every rule

What next?

You have finished the CSS course. Continue with the JavaScript Tutorial to make your pages interactive.

Scroll to Top