Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

background image Nextjs

First import the image file

import bg from '../../assets/images/security-team.jpg'
then apply inline style

style={{
      backgroundImage: `url(${bg.src})`,
      width: '100%',
      height: '100%',
    }}
Comment

next js css background image

/*Please give a thumbs up if this was helpfull*/

<style JSX>{`
    .team {
        width:100%;
        height:100%;
        position:absolute;
        background: url('`+img+`') no-repeat;
    }
`}</style>
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery slick 
Javascript :: js array 
Javascript :: include hover in style jsx 
Javascript :: Upload different files in different folders using Multer in NodeJs 
Javascript :: javascript add parameter to object 
Javascript :: decode raw data to string nodejs 
Javascript :: isfinite javascript 
Javascript :: recursion mdn 
Javascript :: current date jquery and current day 
Javascript :: else return 
Javascript :: jquery get native element 
Javascript :: detect if user is online react 
Javascript :: generate unique random number in javascript 
Javascript :: components in react 
Javascript :: save sort order of jquery sortable 
Javascript :: jest cannot find module 
Javascript :: Make Floating label TextInput in react native 
Javascript :: Aug 25 2020 00:00:00 GMT+0530 
Javascript :: javascript not equal 
Javascript :: js objects 
Javascript :: min max value javascript 
Javascript :: how to check two different length array values are equal in javascript 
Javascript :: create shadow root 
Javascript :: konva line thickness 
Javascript :: exec in node js 
Javascript :: check if a string matches a regex javascript 
Javascript :: js promise api 
Javascript :: show and hide element in react 
Javascript :: return object from map javascript 
Javascript :: uirouter 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =