Relative paths of images in JavaScript

前端 未结 3 2093
我在风中等你
我在风中等你 2021-02-18 23:11

I have a javascript module which creates a div with a picture of a close button (\"X\"). This div and javascript are placed in many places on my site.

Relative path solu

3条回答
  •  礼貌的吻别
    2021-02-18 23:30

    There are three ways to specify a path to an image in html:

    • Completely relative:
    • Absolute with regard to the filesystem, but relative to the current server:
    • Absolute in all respects:

    The second method may work for you.

提交回复
热议问题