【问题标题】:How can I put my css after tapestry css?我怎样才能把我的css放在tapestry css之后?
【发布时间】:2016-09-30 07:45:12
【问题描述】:

我编写了 Tapestry 应用程序,我应该将我的 css 放在 Tapestry css 之后。

我在我的挂毯页面对应的 java 文件中添加了以下代码行:

@Import(stylesheet="http:/localhost:8080/ui-resources/css/styles.css?in_root=0")
void afterRender() {
}

它工作正常。我的问题是我应该给出 css 的相对路径,而不是像现在这样的完整 url。

【问题讨论】:

    标签: tapestry


    【解决方案1】:

    https://tapestry.apache.org/css.html 的 CSS 文档描述了如何使用 @Import 注释以及 Web 应用程序中 CSS 文件的相对 URL:

    @Import(stylesheet="context:css/styles.css")

    如果 CSS 文件在您的网络应用程序之外但在同一个域下,请尝试以下操作:

    @Import(stylesheet="/ui-resources/css/styles.css")

    或在您的模板 (.tml) 文件中放置具有相似 URL 的样式标记。

    【讨论】:

      猜你喜欢
      • 2012-01-07
      • 1970-01-01
      • 2017-05-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-27
      • 2011-08-20
      • 2013-07-22
      相关资源
      最近更新 更多