2017-05-03 29 views
0

我是Confluence的新手。我在玩裝飾和CSS。CSS文件中背景圖片的目錄是什麼?

這是我Atlassian的-plugin.xml中:

<plugin-info> 
    <description>${project.description}</description> 
    <version>${project.version}</version> 
    <vendor name="${project.organization.name}" url="${project.organization.url}" /> 
    <param name="plugin-icon">images/ohanaFavicon.png</param> 
    <param name="plugin-logo">images/ohanaPluginLogo.gif</param> 
</plugin-info> 

<resource type="i18n" name="i18n" location="mysite" /> 

<web-resource key="mysite-resources" name="mysite Web Resources"> 
    <dependency>com.atlassian.auiplugin:ajs</dependency> 
    <context>mysite</context> 
</web-resource> 

<theme key="mysiteheme" name="Mysite Theme" class="com.atlassian.confluence.themes.BasicTheme"> 
    <description>A theme for tests</description> 
    <param name="includeClassicStyles" value="false" /> 
    <resource type="download" name="default-theme.css" location="/includes/css/default-theme.css"> 
     <param name="source" value="webContext" /> 
    </resource> 
    <resource type="download" name="mysite.css" location="/theme-mysite/css/mysite.css" />  
    <resource type="download" name="mysite.js" location="/theme-mysite/js/mysite.js" /> 
    <resource type="download" key="images" name="images/" location="/theme-mysite/images"/> 
    <layout key="${atlassian.plugin.key}:main" /> 
</theme> 

<layout key="main" name="Main Decorator" overrides="/decorators/main.vmd" class="com.atlassian.confluence.themes.VelocityDecorator"> 
    <resource type="velocity" name="decorator" location="/theme-mysite/decorators/main.vmd" /> 
</layout> 

在mysite.css,我有以下的CSS規則:

background: url(images/header-bkgd.png) 5px -115px; 

然而,我我無法看到背景圖像的顯示。我所做的是什麼? 「images」目錄位於「resources」目錄下的「theme-mysite」目錄下。

更廣泛的問題:我已經閱讀了書<>並做了相當多的在線搜索。但是我仍然無法找到任何示例或教程來解釋如何在CSS文件中引用背景圖像。在哪裏獲得這些知識?

最好。

更新

我嘗試這樣做:

background: url(../images/header-bkgd.png) 

當在合流的變化看,Chrome會顯示404的圖像和它的路徑是:

http://localhost:1990/confluence/s/en_GB/6441/NOCACHE/1.0.0-SNAPSHOT/_/download/resources/images/header-bkgd.png 

我也試過

background: url(../theme-mysite/images/header-bkgd.png); 

在Chrome所生成的路徑是:

http://localhost:1990/confluence/s/en_GB/6441/NOCACHE/1.0.0-SNAPSHOT/_/download/resources/theme-mysite/images/header-bkgd.png 

圖像也不存在。

回答

0

你試圖改變這樣的

background: url(../images/header-bkgd.png) 5px -115px; 
+0

晃,感謝插嘴我試過了,它不工作。查看我的更新信息。 – curious1

0

終於得到它解決了自己。我要補充一點:。

<resource type="download" key="images" name="images/" location="/theme-mysite/images"/> 

外面「...」