0

I have jsp page under WebContent/WEB-INF/forms/login.jsp -

<html>
<head>
<link rel="stylesheet" href=/Styles/Styles/Site.css" type="text/css" />
<title>Create new customer</title>
</head>
<body>
</body>
</html>

Site.css is located in WebContent/Styles . When I load login.jsp I see that the css doesn't affects . How write the href correctly?

URL87
  • 10,667
  • 35
  • 107
  • 174
  • What is the full path for the Site.css file? – ChrisHarris2012 Aug 14 '12 at 20:21
  • possible duplicate of [Browser can't access CSS and images when calling a Servlet which forwards to a JSP](http://stackoverflow.com/questions/3655316/browser-cant-access-css-and-images-when-calling-a-servlet-which-forwards-to-a-j/3658735#3658735) – BalusC Aug 14 '12 at 20:25

1 Answers1

1

You can use

<link rel="stylesheet" href="../../Styles/Site.css" type="text/css" />

or if your page is in http://yoursite.com/path/to/WebContent/WEB-INF/forms/login.jsp, you can use

<link rel="stylesheet" href="/path/to/WebContent/Styles/Site.css" type="text/css" />
Oriol
  • 274,082
  • 63
  • 437
  • 513