Using relative URL in CSS file, what location is it relative to?

前端 未结 8 2290
名媛妹妹
名媛妹妹 2020-11-22 03:29

When defining something like a background image URL in a CSS file, when using a relative URL, where is it relative to? For example:

Suppose the file /styleshe

8条回答
  •  鱼传尺愫
    2020-11-22 03:54

    This worked for me. adding two dots and slash.

    body{
        background: url(../images/yourimage.png);
    }
    

提交回复
热议问题