When I set my <P>
tag with a fixed height and overflow:hidden
, the text is displayed. However, when I apply a hover effect to it, I set overflow:visible;
The issue I am facing is that the text is displayed, but I would like to adjust the z-index
and background color of the <p>
. The background should only be displayed for the maximum width of <P>
, changing the background color at the height where the text ends.
CSS:
.oe_description {
overflow:hidden;
max-height:4.2em;
text-overflow: ellipsis;
}
.oe_description:hover {
overflow:visible;
position:relative;
z-index:100;
background: #e5f2f7;
font-weight:bold;
}
View example here: FIDDLE