I am facing an issue with my Spring MVC application where I cannot get an image to display in a CSS file accessed from a JSP file. The CSS is working fine, but the image just won't show up. It seems like there might be an issue with how I am addressing the image file.
I have tried using both absolute and relative addressing methods to access the image, but nothing seems to work.
Here is the snippet of code from my CSS file:
#banner {
text-align: center;
background-image: url("resources/mytheme/images/banner.jpg");
background-repeat: no-repeat;
background-size: 1500px 250px;
height: 250px;
}
And this is how I am linking the CSS file in my JSP file:
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<!-- Importing the style sheet for the template -->
<link href="<c:url value="/resources/mytheme/css/template.css" />" rel="stylesheet">
</head>
<body>
Hello</body>
</html>
Any help or suggestions would be greatly appreciated!