background-image: url("/img/background.jpg");不显示图片,毫无作用


#nr-div{
    width: 40%;
    height: 500px;
    margin: 200px auto;
    background-color: cornflowerblue;
    opacity: 55%;
}  #bod-div{
    background-size: auto;
    background-image: url("/img/background.jpg");
}
   #herder-div{
       width: 40%;
       height: 500px;
       margin: 20px auto;
       background-color: cornflowerblue;
       opacity: 55%;
   }


<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>金窝窝网站</title>
    <link href="<%=basePath %>css/index.css" rel="stylesheet" type="text/css">
</head>
<body>
    <div id="bod-div">
        <div id="herder-div"></div>
        <div id="nr-div">
        </div>
    </div>
</body>
</html>

你f12检查一下是不是无法访问你的文件夹。

图片路径不对吧