gpt4 book ai didi

html - thymeleaf 里面

转载 作者:太空宇宙 更新时间:2023-11-04 08:54:48 24 4
gpt4 key购买 nike

我需要文字环绕图像。我有

<div th:text="${row.getFeed2().getDescription}">
<img style="float: left" th:style="${row.getFeed2().getImage() == null} ? 'default' : 'none'" th:src="${row.getFeed2().getImage()}">
</div>

但是 Thymeleaf 删除了内部标签 <img>我已经探索了很多选项,但没有任何效果。

提前致谢

最佳答案

将文本移动到另一个标签内。像这样:

<div>
<span th:text="${row.getFeed2().getDescription}" />
<img style="float: left" th:style="${row.getFeed2().getImage() == null} ? 'default' : 'none'" th:src="${row.getFeed2().getImage()}">
</div>

编辑 2(无跨度):

<span>
<th:block th:text="${row.getFeed2().getDescription}" />
<img style="float: left" th:style="${row.getFeed2().getImage() == null} ? 'default' : 'none'" th:src="${row.getFeed2().getImage()}">
</span>

<span th:inline="text">
[[${row.getFeed2().getDescription}}]]
<img style="float: left" th:style="${row.getFeed2().getImage() == null} ? 'default' : 'none'" th:src="${row.getFeed2().getImage()}">
</span>

关于html - thymeleaf <img> 里面 <div th :text>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43188758/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com