Quiz: CSS and Built-In Styles Methods

Test yourself on what you've learned in this chapter.

1

What will be the output of the following code snippet?

const Header = () => (
  <header>
    <h1 className="title">Hello, World!</h1>
    <style jsx>{`
      .title {
        font-size: 24px;
        color: red;
      }
    `}</style>
  </header>
);

export default Header;

A)

The header text will be displayed with a font size of 24 pixels and a red color.

B)

The header text will be displayed with a default font size and color.

C)

The header text will not be displayed due to an error in the code.

D)

The header text will be displayed, but the styles defined in the style tag will not be applied.

Question 1 of 60 attempted

Get hands-on with 1200+ tech skills courses.