node.js - Linking to a static file from within statics in Expressjs -


i've got weird issue can't seem figure out expressjs. i've specified public folder static files such js, css , images. i'm using app.use(express.static(__dirname + '/public')); specify folder. works except 1 case.

inside public folder, i've got 3 folders called js, css , images. within 1 of css files, i'm doing background-image: url(/images/bg.png) no-repeat; url not resolving , image not showing on page.

however, if img(src='/images/bg.png') within 1 of views, image shows. i'm assuming has fact i'm linking static file , node/express ignoring routes(?) within static files.

how 1 go linking images in css files located inside static folder in express?

your css urls relitive stylesheet url have looking path /css/images/bg.png want have url ../images/bg.png


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -