html 写一个超链接在一个新的页面链接到一个网址 用并且不覆盖新的页面thymeleaf 后端用spring boot
HTML代码:
<a href="https://www.example.com" target="_blank">前往网址</a>
Thymeleaf代码:
<a th:href="@{https://www.example.com}" target="_blank">前往网址</a>
Spring Boot与Thymeleaf集成时,可以使用Thymeleaf模板引擎渲染HTML页面。上述Thymeleaf代码中,@{}中的内容表示一个表达式,用于生成URL地址。th:href属性用于将生成的URL地址作为链接的目标。target="_blank"用于设置链接在新的页面中打开。
原文地址: https://www.cveoy.top/t/topic/fcj0 著作权归作者所有。请勿转载和采集!