Answers for "how to use an image as a background in styles react js"

9

how to add background image in react css

import React from 'react';
import car from './images/car.png'
function App() {
  return (
    <div  styles={{ backgroundImage:`url(${car})` }}>      <h1>This is red car</h1>
    </div>
  );
}

export default App;
Posted by: Guest on July-23-2020
6

Setting a background Image With React Inline Styles

backgroundImage: `url(${Background})`
Posted by: Guest on July-06-2020

Code answers related to "how to use an image as a background in styles react js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language