Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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%',
    }}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #background #image #Nextjs
ADD COMMENT
Topic
Name
9+4 =