html - How to prevent a p:menubar from being overlapped by the contents of a CSS template? -
i have following kind of layout on header of template i'm using.
this layout made of <p:panelgrid>
renders html table.
i'm using following template.
<?xml version='1.0' encoding='utf-8' ?> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html lang="#{localebean.language}" xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"> <f:view locale="#{localebean.locale}" encoding="utf-8" contenttype="text/html"> <f:loadbundle basename="messages.resourcebundle" var="messages"/> <ui:param name="contextpath" value="#{request.contextpath}"/> <ui:insert name="metadata"></ui:insert> <h:head> <title><ui:insert name="title">default title</ui:insert></title> <h:outputstylesheet library="default" name="css/block-ui.css"/> <h:outputstylesheet library="default" name="css/template.css"/> </h:head> <h:body id="body"> <div id="container" class="clearfix"> <div id="north"><ui:include src="/web-inf/client_template/content_bars/northmain.xhtml"/></div> <div id="west"></div> <div id="east"></div> <div id="content"> <ui:insert name="content">put default content here, if any.</ui:insert> </div> </div> <div id="south"></div> </h:body> </f:view> </html>
the css used follows (template.css).
html, body { height: 100%; min-width: 800px; margin: 0; padding: 0; font-family: "helvetica neue", helvetica, arial, verdana, sans-serif; background: #fff; font-size: 12px; } #container { min-height: 100%; margin: 0 auto -90px; } #north { height: 165px; background: #fff; } #west { float: left; width: 120px; background: #fff; } #content { margin-left: 120px; margin-right: 120px; background: #fff; } #east { float: right; width: 120px; background: #fff; } #south, #container:after { height: 90px; } .clearfix:after { display: block; content: " "; clear: both; } #south { height: 300px; color: #444; background: #777; border-top: 7px solid #000; clear: both;padding: 15px; }
this this answer.
i'm using <p:menubar>
on header of page indicated picture above. menu overlapped content - menu goes behind contents.
this happens because i'm using following css class clip content of <p:panelgrid>
on header, when text displays not fit cells - text-overflow: ellipsis
.
.headerelipses { table-layout: fixed; width: 100%; border-collapse: collapse; } .headerelipses td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
if class removed then, works fine - menu not overlapped contents. cannot avoid text-overflow: ellipsis
because application multilingual , there variable number of characters displayed in <p:panelgrid>
columns depending upon language selected user in addition displaying dynamic text.
i have tried setting z-index
higher value like
z-index: 20 !important; overflow: visible !important;
to #north
css class above did not work.
how prevent <p:menubar>
being overlapped contents?
i believe z-index not work unless have declared position element. if don't have 1 currently, suggest putting position: relative; along z-index on each affected element.
Comments
Post a Comment