I have a CSS class which outputs a line after a title
This works in Safari and Chrome but in Firefox the line is not appearing.
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 container div has a class of Sidebar
JSFiddle as requested
http://jsfiddle.net/jerswell/Lxsmt96k/
The problem is the z-index
, put a lower z-index
to the sidebar class, so it won't be hidden anymore.
Here is a new fiddle, I have just simply put z-index: -2;
to the .sidebar
selector.
PS (nitpicking): In CSS3 after
is not a pseudo-class but a pseudo-element, and there is a new notation for it: ::after
(however the old notation still works)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With