zoukankan      html  css  js  c++  java
  • Liferay 加载自定义css 文件

    参考:https://developer.aliyun.com/article/427829

    (1) 对于特别通用的文件,比如是ext-js库要使用到的css文件,你可以有2个选择:

    选择1:放在ROOT/html/common/themes/top_head.jsp中:

    
    
    1. .. 
    2. <%-- Portal CSS --%
    3. <!--added by charles to load the ext-js css library--> 
    4. <link href="<%= HtmlUtil.escape(PortalUtil.getStaticResourceURL(request, themeDisplay.getCDNHost() + themeDisplay.getPathContext() + "/html/css/extjs/resources/css/ext-all.css")) %>" rel="stylesheet" type="text/css" /> 
    5.  
    6. <link href="<%= HtmlUtil.escape(PortalUtil.getStaticResourceURL(request, themeDisplay.getCDNHost() + themeDisplay.getPathContext() + "/html/css/main.css")) %>" rel="stylesheet" type="text/css" /> 
    7. .. 

    这种情况下,它将是整个服务器中第一个被加载的css(因为top_head.jsp被portal_normal.vm中包含):

    选择2:放在ROOT/html/css/main.css以@import形式给出:

    
    
    1. @import url(portal/aui.css); 
    2.  
    3. /* 
    4. * add by charles here to load the global css 
    5. */ 
    6. @import url(extjs/resources/css/ext-all.css); 
    7.  
    8. @import url(portal_1.css); 
    9. @import url(portal_2.css); 
    10.  
    11. @import url(taglib_1.css); 
    12. @import url(taglib_2.css); 
    13.  
    14. @import url(portal/openid.css); 
    15. @import url(portal/accessibility.css); 

    这种情况下, 这个css文件在所有的webapps下面的包含ROOT应用在内的所有应用的main.css加载之后,但是深入main.css中被包含的外部css文件之前被加载。

    (2) 对于某个theme用到的css文件,你可以在这个theme的main.css中以@import形式给出

    (3)对于某个portlet所特有的css文件,你可以在这个portlet的main.css中以@import形式给出

  • 相关阅读:
    计算机注销、热启动、冷启动
    从高处理解android与服务器交互(看懂了做开发就会非常的容易)
    Android—Work—1day
    软件需求分析方法
    Android 常用控件的介绍
    android中Json的一些应用
    java数据传递例子+内存分析
    android中MVP模式
    android的四层体系结构,基于mvc三层结构浅析
    java
  • 原文地址:https://www.cnblogs.com/show58/p/13813632.html
Copyright © 2011-2022 走看看