如何集中初始菜单? [英] How to centralize primefaces menubar?

查看:133
本文介绍了如何集中初始菜单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要集中管理菜单。我尝试这样:< p:menubar style =text-align:center!important> 但它没有工作。

I need to centralize the primefaces menubar. I tried this: <p:menubar style="text-align: center !important"> but it did not work.

请帮助!

推荐答案

为了将元素放在菜单栏你会这样,因为酒吧是100%的宽度。
在facelet中将styleclass属性添加到菜单中:

To center elements in the menubar (aka center the content), I think you would this because the bar is 100% width. In the facelet add the "styleclass" attribute to the menubar:

<p:menubar styleClass="centeredMenuBar">  

并在css文件中添加:

and in the css file just add:

.centeredMenuBar.ui-menubar {
    text-align: center;
}

.centeredMenuBar .ui-menu-list {
    display: inline-block;
}

这篇关于如何集中初始菜单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆