【发布时间】:2017-02-15 18:29:00
【问题描述】:
我使用 thymeleaf 作为模板开发了一个 spring-boot 应用程序。我在 application.properties 中使用服务器上下文路径。
server.context-path: /myapp/v1.0
当我需要在我的views.html中显示图像时,我会使用这种语法
<img th:src="@{/img/first.png}" />
一切都很酷
但是当我需要在我的 css 文件中使用图像时它不起作用
/* Search input */
input.search-input {
text-align: left;
background-image: url('/img/search.png');
}
你有什么想法吗?
感谢您的回答
【问题讨论】:
标签: spring-boot thymeleaf contextpath