My project structure:
hello.jsp:
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
<title>Title</title>
<meta charset="utf-8">
<link href="<c:url value="/resources/myStyle.css" />" rel="stylesheet">
</head>
<body>
<h1>Text</h1>
<p>Text.</p>
</body>
</html>
myStyle.css:
body {
font-family: Arial, Verdana, sans-serif;
font-size: 11pt;
background-color: #f0f0f0;
color: #333;
}
h1 {
color: #a52a2a;
font-size: 24pt;
font-family: Georgia, Times, serif;
font-weight: normal;
}
p {
text-align: justify;
margin-left: 60px;
margin-right: 10px;
border-left: 1px solid #999;
border-bottom: 1px solid #999;
padding-left: 10px;
padding-bottom: 10px;
}
Could someone please explain me why css doesn't work? I use Intellij IDEA as IDE and Tomcat.
This works though:
<style>
<%@include file="/resources/myStyle.css" %>
</style>