【问题标题】:p:layout and p:layoutUnit ignore the stylep:layout 和 p:layoutUnit 忽略样式
【发布时间】:2015-05-18 19:08:38
【问题描述】:

我的问题很简单。我正在使用 PrimeFaces 4.0 和布局组件。

问题来了,当我尝试调整它的 CSS 时。 我想将其背景设置为无,我尝试了经典的style="background: none !important,但它忽略了我,然后我检查了谷歌浏览器中的元素,发现.ui-widget-content 样式是我想要隐藏的样式,然后我试试这个:

<p:layout style="min-width:400px;min-height:1000px; .ui-widget-content {background: none !important;}">
<p:layoutUnit position="west" size="620" minSize="40" style=".ui-widget-content {background: none !important;}">

但它仍然不起作用。另外,在我的 css 主题中,我有:

body .ui-widget-content {

    border-style: hidden;
    border-color: white;
    border-width: 0px;
    color: #4f4f4f;
}

如果我在其中添加背景:无,它确实有效,但会搞砸我整个应用程序的主题。 有没有办法隐藏单个小部件内容的背景?

【问题讨论】:

    标签: css jsf primefaces


    【解决方案1】:

    不要摆弄style 属性。只需给它一个你在 CSS 文件中声明的类。

    <p:layout styleClass="backgroundless">
    
    .ui-layout-container.backgroundless .ui-widget-content {
        background: none;
    }
    

    另见:

    【讨论】:

    • 非常感谢您的回答。这正是我所需要的。有空我去看看css教程,再次感谢大佬!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-08
    • 2014-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多