[英]Primefaces : how to create <p:menubar> dynamically in primefaces 4?
[英]How to centralize primefaces menubar?
我需要集中 primefaces 菜單欄。 我試過這個: <p:menubar style="text-align: center !important">
但它沒有用。
請幫忙!
中心菜單欄,而不是內容(從 primefaces 展示修改):
<p:menubar style="width: 100px; margin-left:auto; margin-right:auto;">
<p:submenu label="Blah" icon="ui-icon-document" />
<p:submenu label="Blah2" icon="ui-icon-document" />
<p:menuitem value="Quit" url="http://www.primefaces.org"
icon="ui-icon-close" />
</p:menubar>
要使菜單欄中的元素居中(也就是將內容居中),我認為您會這樣做,因為該欄的寬度為 100%。 attribute to the menubar:在 facelet 中,將屬性添加到菜單欄:
<p:menubar styleClass="centeredMenuBar">
並在 css 文件中添加:
.centeredMenuBar.ui-menubar {
text-align: center;
}
.centeredMenuBar .ui-menu-list {
display: inline-block;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.