wangjie 2018-09-25
theamleaf CSS内联表达式和js内联表达式和取值类似
<style th:inline="css"> ... </style>
假设我们有两个变量设置为两个不同的String值:
classname = ‘vue1 view1’ align = ‘center’
使用如下表达式
<style th:inline="css">
.[[${classname}]] {
text-align: [[${align}]];
}
</style>结果将是
<style th:inline="css">
.vue1 view1{
text-align: center;
}
</style>
1下面给出一个设置theamleaf CSS设置背景的实例
.backGroundImg{
/*background-image: url("http://www.it399.com");*/
background-image: url("[[${myURL.mSrcURL}]]/imgs/tools/zuji/zuji_map_bg.png");
}