Shiva Shinde Shiva Shinde - 1 year ago 64
HTML Question

How to add body element in facebook's reactjs my-app?

I want to add a background image on Facebook's react.js my-app. I can do this by setting a background image to a div element. But my div only covers half of the page. Which is why my image is not fulling occupying the page.

Instead, I want to do this on a body element. But how to add a body element and set a background image to it?

I tried this, but its not working in App.js file of my-app

<body background=""></body>

Answer Source

For some reason, I cannot add a background image on app.js or app.css files of react framework. However, I tried to do it on index.html. This worked perfectly to me.

So, please add background images on index.html If you are unable to do it in app.js or app.css.

And also, future readers, If you have found a way to do it, feel free to answer the question, thanks!!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download