liferay中css的自定義匯入

2021-07-15 09:44:40 字數 1276 閱讀 8136

1) 對於特別通用的檔案,比如是ext-js庫要使用到的css檔案,你可以有2個選擇:

選擇1:放在root/html/common/themes/top_head.jsp中:

.. 

<%-- portal css --%>

<

link

href="<%= htmlutil.escape(portalutil.getstaticresourceurl(request, themedisplay.getcdnhost() + themedisplay.getpathcontext() + "/html/css/extjs/resources/css/ext-all.css")) %>" rel="stylesheet"

type="text/css"

/>

<

link

href="<%= htmlutil.escape(portalutil.getstaticresourceurl(request, themedisplay.getcdnhost() + themedisplay.getpathcontext() + "/html/css/main.css")) %>" rel="stylesheet"

type="text/css"

/>

..

這種情況下,它將是整個伺服器中第乙個被載入的css(因為top_head.jsp被portal_normal.vm中包含):

選擇2:放在root/html/css/main.css以@import形式給出:

@import url(portal/aui.css); 

/** add by charles here to load the global css

*/@import url(extjs/resources/css/ext-all.css); 

@import url(portal_1.css); 

@import url(portal_2.css); 

@import url(taglib_1.css); 

@import url(taglib_2.css); 

@import url(portal/openid.css); 

@import url(portal/accessibility.css); 

(2) 對於某個theme用到的css檔案,你可以在這個theme的main.css中以@import形式給出

(3)對於某個portlet所特有的css檔案,你可以在這個portlet的main.css中以@import形式給出

Liferay 載入自定義css 檔案

參考 1 對於特別通用的檔案,比如是ext js庫要使用到的css檔案,你可以有2個選擇 選擇1 放在root html common themes top head.jsp中 portal css rel stylesheet type text css rel stylesheet type t...

CSS自定義字型

css 允許自定義字型庫的乙個屬性 font face 自定義字型資訊 format 指定自定義的字型的格式 指定字型的路徑和字型格式 src url fonts icomoon.eot eot 相容ie4以上的字型格式 turetype ttf 格式 ie9以上,firefox opentype ...

CSS自定義屬性

1.自定義屬性的使用方法 自定義屬性分為 區域性自定義屬性 全域性自定義屬性 使用 宣告自定義屬性 使用兩個 宣告 例如 bg color red 注意這裡有乙個 冒號 這樣就宣告了乙個自定義屬性 bg color 和red 宣告後如何使用 var 自定義屬性名 括號還是要加上兩個 backgrou...