Tsallaka zuwa abun ciki
Justice Tech School

Inline Styles

The style prop takes an object with camelCase keys.

Example
function Box() {
  return <div style={{ backgroundColor: "teal", padding: 8 }}>Hi</div>;
}

Exercise

Style object.

style={ color: "red" }}

Quiz Test

What type is the style prop?

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