为什么CSS不是用chrome渲染而是在Eclipse中工作?

时间:2014-04-01 22:41:04

标签: css jsf

我在我的应用程序的前端使用JSF。 CSS在Eclipse中正确呈现,但在chrome浏览器中不起作用。这是我在JSF中调用CSS文件的方法。谁能告诉我问题是什么。感谢

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"

<h:head>
<title>Login Page</title>
</h:head>
<h:body>
<h:outputStylesheet library="css" name="style.css"  />

2 个答案:

答案 0 :(得分:2)

问题在于Chrome 缓存 CSS资源 - 所以只使用旧的过时版本。

虽然应该为实时部署正确配置资源缓存控制,但可以在Chrome中快速执行"force refresh"但按 Ctrl + F5 (或Ctrl + Windows中的Shift + R)和OS X中的Cmd + Shift + R.

或者,the cache control can be configured from the Chrome Developer tools

答案 1 :(得分:1)

我经常遇到这个问题。

我不是点击F5,而是手动点击刷新,它通常有效。 Firefox也可以提供帮助。