Shiva Shinde Shiva Shinde - 1 month ago 6
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="http://i.imgur.com/DaNQJ6I.jpg"></body>

Answer

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!!

Comments