在 Confluence 4.0 中使用 css 设置速度标记样式

发布于 2024-12-21 19:03:45 字数 278 浏览 3 评论 0原文

我写了一个汇合宏。它使用速度来生成 html 表。如果我在速度模型中不使用 标签,如何使用 css 设置此标记的样式。我尝试按照 this 示例执行操作,但 id不起作用(我的意思是它没有效果,并且没有我在宏结果页面的代码中指定包含的CSS资源文件)

I have written a confluence macro. It uses velocity to generate html table. How can I style this markup with css if I don't use <html> and <head> tags in my velocity model. I have tried to do as in this example but id doesn't work(I mean it takes no effect and there is no css resource file that I have specified inclusion on the code of result page of macro)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心安伴我暖 2024-12-28 19:03:45

如果我理解正确的话
您需要将 css 文件上的链接添加到 atlasian-plugin.xml
例如

<atlassian-plugin name='Just name' key='com.your.path.to.lib'
              plugins-version="2">
 <resource type="download" name="style.css" location="css/style.css">
        <property key="content-type" value="text/css"/>
    </resource>
</atlassian-plugin>

,之后您需要将此链接添加到速度模板的顶部

<link rel="stylesheet" href="$req.contextPath/com.your.path.to.lib/style.css"
      type="text/css"/>

if i understand you correctly
you need to add links on your css files to atlasian-plugin.xml
for example

<atlassian-plugin name='Just name' key='com.your.path.to.lib'
              plugins-version="2">
 <resource type="download" name="style.css" location="css/style.css">
        <property key="content-type" value="text/css"/>
    </resource>
</atlassian-plugin>

after that you need to add this link to the top of your velocity template

<link rel="stylesheet" href="$req.contextPath/com.your.path.to.lib/style.css"
      type="text/css"/>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文