How do i set the color of body with react --- still need help please

How do I set the color for the background the way I’m setting the color for h1 and h2 ?

in react you need to use camel case for the properties, i.e. backgroundColor

that should work i think.

I’ve tried that, but does not work.

you don’t need the style tag, you use style as a prop/attribute on the component you want to render. It should look something like this:

<div style={{backgroundColor: 'blue'}} /></div>

How would that work in my code? It doesn’t change the color

I guess your problem is a bit trickier since you are trying to change the background color of the body. It works fine if you add that style to your quotebox div. I don’t want to give you any wrong info as I’m just a learner like you but that’s what I know.

On codepen you can think of everything in the left html editor as inside the “body” of the html. So your root div is already inside the body which means all of your react code is inside the body.

Btw your render function shouldn’t include a div with id root, that div already exists in your base html file, so you end up rendering a div inside a div both having the same id of root.

Thanks for explaining that, I went ahead and fixed it .