Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

set background image in material ui

import React from 'react';

import Paper from 'material-ui/Paper';

import IconButton from 'material-ui/IconButton';
import ActionHome from 'material-ui/svg-icons/action/home';

import Image from '../img/main.jpg'; // Import using relative path


const styles = {
    paperContainer: {
        backgroundImage: `url(${Image})`
    }
};

export default class Home extends React.Component{
    render(){
        return(
            <Paper style={styles.paperContainer}>
                Some text to fill the Paper Component
            </Paper>
        )
    }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: JavaScript changing the color of an html element 
Javascript :: Error: Expected "payload" to be a plain object. at validate 
Javascript :: effect jquery 
Javascript :: how to get id from url in javascript 
Javascript :: set cookie javascript 
Javascript :: bind to constructor 
Javascript :: empty the value of an input in jquery 
Javascript :: remove item from array by id 
Javascript :: javascript clear form after dubmit 
Javascript :: javascript body element 
Javascript :: js random number 
Javascript :: convert seconds to hours minutes seconds javascript 
Javascript :: nodejs tcp client 
Javascript :: external linking of JavaScript in html 
Javascript :: foreach jquery 
Javascript :: regular expression number from 1 to 100 
Javascript :: context.lineto 
Javascript :: reactjs download file axios 
Javascript :: check if date is valid 
Javascript :: javascript regex test number only 
Javascript :: getelementbytagname js 
Javascript :: sh: 1: nodemon: not found heroku 
Javascript :: parse date do weekday 
Javascript :: max_safe_integer 
Javascript :: parsefloat.tofixed in javascript 
Javascript :: bootstrab close modal 
Javascript :: node.js socket.io send data with handshake 
Javascript :: jquery ajax type json 
Javascript :: use js variable in blade route 
Javascript :: hemisphere light three js 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =