Jsf p:commandButton样式类如rounded button不起作用

Jsf p:commandButton样式类如rounded button不起作用,jsf,primefaces,Jsf,Primefaces,我曾尝试应用prime faces演示中提供的样式,但未能获得结果。我试过的代码如下 <h:head> <title>Facelet Title</title> <style type="text/css"> button.ui-button { margin-right: .5rem; } &

我曾尝试应用prime faces演示中提供的样式,但未能获得结果。我试过的代码如下

    <h:head>
        <title>Facelet Title</title>
        <style type="text/css">
            button.ui-button {
                margin-right: .5rem;
            }
        </style>
    </h:head>
    <h:body>
    <div class="card">
        <h5>Basic</h5>
        <p:commandButton type="button" value="Submit" />

        <h5>Icons</h5>
        <p:commandButton type="button" icon="pi pi-check" />

        <h5>Severities</h5>
        <p:commandButton type="button" value="Primary" />
        <p:commandButton type="button" value="Secondary" styleClass="ui-button-secondary" />

        <h5>Raised Buttons</h5>
        <p:commandButton type="button" value="Primary" styleClass="ui-button-raised" />

        <h5>Rounded Buttons</h5>
        <p:commandButton type="button" value="Primary" styleClass="rounded-button" />

        <h5>Flat Buttons</h5>
        <p:commandButton type="button" value="Primary" styleClass="ui-button-flat" />

        <h5>Raised Text Buttons</h5>
        <p:commandButton type="button" value="Primary" styleClass="ui-button-raised ui-button-flat" />

        <h5>Outlined Buttons</h5>
        <p:commandButton type="button" value="Primary" styleClass="ui-button-outlined" />

        <h5>Rounded Icon Buttons</h5>
        <p:commandButton type="button" icon="pi pi-bookmark" styleClass="rounded-button ui-button-secondary" />

        <h5>Rounded Text Icon Buttons</h5>
        <p:commandButton type="button" icon="pi pi-check" styleClass="rounded-button ui-button-flat" />

        <h5>Rounded and Outlined Icon Buttons</h5>
        <p:commandButton type="button" icon="pi pi-check" styleClass="rounded-button ui-button-outlined" />
    </div>

Facelet标题
button.ui-button{
保证金权利:.5rem;
}
基本的
图标
严重性
凸起的按钮
圆形按钮
扁平按钮
凸起的文本按钮
轮廓按钮
圆形图标按钮
圆形文本图标按钮
圆形和轮廓图标按钮
但未按要求显示结果


请告诉我需要添加什么样式表。

这些按钮类是在PrimeFaces 10中引入的。如果您不在该版本上,或者您还没有升级您的高级主题,它们将无法工作

因此,如果您不想添加自定义CSS,或者为您希望在项目中支持的类添加自定义CSS,请升级。例如,对于
圆形按钮
,您希望将其添加到自定义样式表中:

body.ui-button.rounded-button{
边界半径:2em;
}
另见:


您是否介意帮助我如何在maven项目中添加primefaces 10请注意,我甚至无法在我的项目中添加版本10。在AddDependency对话框中,当我选择任何给定工件(如10.0.0[jar.asc.sha256,jakarta]-central)时,它会转到非类路径依赖项。请参阅,但仅仅更改依赖项并不是全部。请阅读迁移指南。