Skip to content
Justice Tech School

Styling Components

Style with className and a CSS file, with the style prop taking an object of camelCase properties, or with CSS Modules which scope class names.

Example
<p style={{ color: 'tomato', fontSize: 18 }}>Hi</p>

import styles from './Button.module.css';
<button className={styles.primary}>Go</button>

Exercise

Inline style takes an ___.

style={{ color: "red" }} is an 

Quiz Test

How do you write font-size in a style object?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.