Answers for "background image in react"

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
16

react background image

style={{  
  backgroundImage: "url(" + "https://images.pexels.com/photos/34153/pexels-photo.jpg?auto=compress&cs=tinysrgb&h=350" + ")",
  backgroundPosition: 'center',
  backgroundSize: 'cover',
  backgroundRepeat: 'no-repeat'
}}
Posted by: Guest on April-12-2020
1

how to import background image in inline css in react

style={{backgroundImage: `url(${pencil})`}}
Posted by: Guest on April-30-2020
1

background image react

in your css 

.background {
  background-image: url('./Images/img.png')
}
Posted by: Guest on September-26-2021
0

set image as background react

<div  styles={{ backgroundImage:`url(${car})` }}>
Posted by: Guest on October-01-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language