Firefox :: after pseudo element doesn't work
I have a CSS class that outputs a line after the title
This works in Safari and Chrome, but the line doesn't appear in Firefox.
My code:
.sidebar h2 {
color: #f7f7f7;
width: 100%;
font-size: 24px;
position: relative;
}
.sidebar h2 span {
background-color: #40d1b0;
padding-right: 2px;
}
.sidebar h2::after {
content:"";
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 0.22em;
border-top: 1px solid rgba(0,0,0,0.10);
z-index: -1;
}
<h2><span>Show</span></h2>
The div container has a class Sidebar
EDIT
JSFiddle as requested
source to share
The problem is z-index
, set the bottom one z-index
to the sidebar class so that it doesn't hide anymore.
Here is a new fiddle , I just put z-index: -2;
in a selector .sidebar
.
PS (nitpicking): In CSS3 after
it is not a pseudo-class, but a pseudo-element, and there is a new notation for it: ::after
(however the old notation works)
source to share