CSS   发布时间:2022-04-17  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了css – PrimeFaces 2.2.1在本地看起来与展示柜不同大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我已经看到类似的问题 herehere.这两个都没有回答我的问题.我也搜索了 PrimeFaces forum.

在NetBeans中设置一个香草JSF 2.0项目,我添加了Simple Dialog的Showcase代码.

代码(index.xhtml)减去xml声明和DOCTYPE(XHTML 1.0 Transitional):

<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:p="http://primefaces.prime.com.tr/ui">
<h:head>
    <title>PrimeFaces</title>
</h:head>
<h:body>
    <h:panelGrid columns="1" celLPADding="5">
        <p:commandButton value="Basic" onclick="dlg1.show();" type="button"/>

        <p:commandButton value="Modal" onclick="dlg2.show();" type="button"/>

        <p:commandButton value="Effects" onclick="dlg3.show();" type="button"/>
    </h:panelGrid>

    <p:dialog header="Basic Dialog" widgetVar="dlg1">
        <h:outputText value="Resistance to PrimeFaces is futile!" />
    </p:dialog> 

    <p:dialog header="Modal Dialog" widgetVar="dlg2" modal="true" height="200">
        <h:outputText value="This is a Modal Dialog." />
    </p:dialog> 

    <p:dialog header="Effect Dialog" widgetVar="dlg3" showEffect="bounce" hideEffect="explode" height="200">
        <h:outputText value="This dialog has cool effects." />
    </p:dialog>
</h:body>

我将aristo主题添加到我的Libraries(NetBeans添加到classpath中),并将以下内容添加到web.xml

web.xml(部分):

<context-param>
    <param-name>primefaces.THEME</param-name>
    <param-value>aristo</param-value>
</context-param>

没有其他更改,然我很快安装/卸载另一个主题(黑暗蜂巢),只是为了确保主题正在注册正确.结果如下:

本地(Chrome 15.0.874.92):

展示:(从PrimeFaces Showcase)

堆栈:
PrimeFaces 2.2.1
JSF 2.0
玻璃鱼3.1.1
Java 1.6.0_18
Windows 7 x64
(由NetBeans 7.0.1生成)

编辑:这也是在FireFox 7.0.1和IE 9上测试的

解决方法

默认字体大小不是问题吗?从 showcase css可以看出,它有自定义字体大小覆盖主题的默认值:
body {
    margin: 0px;
    padding: 0;
    font-size: 12px;
    color: #616161;
}

我查了一些我的项目,他们都有一些font-size / font-family定制.希望有帮助

大佬总结

以上是大佬教程为你收集整理的css – PrimeFaces 2.2.1在本地看起来与展示柜不同全部内容,希望文章能够帮你解决css – PrimeFaces 2.2.1在本地看起来与展示柜不同所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。