I have the following kind of layout on the header of the template I'm using.
This layout is made up of <p:panelGrid>
which renders an HTML table.
I'm using the 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 is as 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 is from this answer.
I'm using a <p:menubar>
on the header of the page as indicated the picture above. The menu is overlapped by the content - the menu goes behind the contents.
This happens because I'm using the following CSS class to clip the content of the <p:panelGrid>
on the header, when the text it displays does not fit its cells - text-overflow: ellipsis
.
.headerElipses {
table-layout: fixed;
width: 100%;
border-collapse: collapse;
}
.headerElipses td {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
If this class is removed then, it works fine - the menu is not overlapped by the contents. I cannot avoid text-overflow: ellipsis
because the application is multilingual and there are variable number of characters to be displayed in the <p:panelGrid>
columns depending upon the language selected by a user in addition to displaying some dynamic text.
I have tried setting z-index
to a higher value like
z-index: 20 !important;
overflow: visible !important;
to the #north
CSS class above but it did not work.
How to prevent the <p:menubar>
from being overlapped by the contents?