search

Home  >  Q&A  >  body text

How to set a background image using Next.js?

I tried setting the background image using Next.js but couldn't.

This won't work. Picture will not be displayed:

// globals.css

body {
  background: url("/images/grid.svg") repeat;
}

I want to repeat the background image throughout the page like this:

How to set it up? Thank you in advance!

P粉725827686P粉725827686473 days ago551

reply all(1)I'll reply

  • P粉752826008

    P粉7528260082023-09-10 00:14:40

    Try this.

    background-image: url('/images/grid.svg');

    reply
    0
  • Cancelreply