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'
}}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;style={{backgroundImage: `url(${pencil})`}}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'
}}
Also in JavaScript:
- flat function javascript
- javascript map callback function
- javascript for loop[
- get href attribute javascript
- how to make a circle in js
- react environment variables
- get children length jquery
- vue timeout
- how to add headers to the server response node js
- nodejs websocket tutorial
- discord.js rich embed
- how to select data attribute in javascript using queryselectorAll
- search array for property js
- find last element in array nodejs
- multiple ckeditor on same page
- react $ r component instance console
- how to remove last element in js
- angular material theme colors
- core.js:6228 ERROR TypeError: Cannot read property 'image' of undefined
- ready function jquery
- js hide element by id
- javascript function in brackets
- javascript object freeze
- transform array to string js