Answers for "how to properly make a background image react"

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
0

background image in react from variable

var divStyle = {
  backgroundImage: 'url(' + imgUrl + ')',
  width: '300px'
};
Posted by: Guest on January-12-2021

Code answers related to "how to properly make a background image react"

Code answers related to "Javascript"

Browse Popular Code Answers by Language