I have a page which I load both on a local Tomcat 7 instance and a remote JBoss instance (OpenShift). The css is applied on JBoss, but not on Tomcat 7:
Html page head:
<head>
<title><decorator:title /></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" type="text/css" href="/static/css/reset.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/static/css/960gs-16col.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/static/css/default.css" media="screen" />
</head>
Default.css
body {
background-color: #c73b0b;
}
rest.css and default.css are not applied on Tomcat 7. I checked with FireBug, no bugs reported. I checked the page source code on both systems, exactly the same.
What could cause this issue?
As we resolved together with @JVerstry:
Seems that Tomcat wasn’t loading the CSS files the same way as JBoss.
/static/css/reset.cssis an absolute path. Ifreset.cssis part of the application, it should be referenced asstatic/css/reset.css(without the leading slash)