Answers for "react image background example"

9

backgroundImage react

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

react native background image

return (
  <ImageBackground source={...} style={{width: '100%', height: '100%'}}>
    <Text>Inside</Text>
  </ImageBackground>
);
Posted by: Guest on June-13-2020
2

add background image react native

return (
  <ImageBackground source={...} style={{width: '100%', height: '100%'}}>
    ......All Children tags
  </ImageBackground>
);
Posted by: Guest on October-30-2020
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