Gif图像在thymeleaf-html页面中不起作用? [英] Gif image not working in thymeleaf-html page?

查看:154
本文介绍了Gif图像在thymeleaf-html页面中不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

设置方法相同.所以我在百里香中使用相同的方式

in html image and gif are set as same way. so i use same way in thymeleaf

在百里香叶中将图像设置为

In thymeleaf the image set as

 <img th:attr="src=@{${ball.png}} , title=#{background}, alt=#{background}" style="width: 150px; height: 150px;" />

与设置为

<img th:attr="src=@{${run.gif}} , title=#{background}, alt=#{background}" style="width: 150px; height: 150px;" />

该图片将显示在那里,但是gif图片不显示在那里

the image will show there but gif image not shows there

我不知道为什么会这样.

i don't know why this happening.

如果您知道答案,请在这里分享.

if you know the answer please share here.

推荐答案

@ {$ {run.gif}} 尝试使用我怀疑是否存在 run 属性.

@{${run.gif}} tries to URL rewrite with the property gif of an attribute run, which I doubt there is.

如果要相对于上下文引用图像,则应执行 @ {/run.gif} .

You should do @{/run.gif} if you want to refer to the image relatively to your context.

文档:胸腺URL语法

这篇关于Gif图像在thymeleaf-html页面中不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆