Hi there,
I’m trying to implement a button on my site that has a “shadow” underneath it – it’s not actually a shadow, it’s making use of the :after pseudo element to add a coloured block underneath. Here’s my CSS:
.reply-button {
background-color: var(--bg);
border: 2px solid var(--text);
text-decoration: none;
padding: 10px 30px;
font-weight: bold;
font-size: 30px;
position: relative;
color: var(--text);
}
.reply-button:after{
content: '';
position: absolute;
background-color: var(--text);
top:8px;
left:8px;
right:-8px;
bottom:-8px;
z-index: -1;
}
Problem is, when I set the z-index
to -1 the backgound goes behind the body, so it’s not visible. I’ve tried setting .reply-button
to 2 and the :after
to 1, but this just ends with the background being on top. What am I doing wrong here? This css worked fine with another theme.
Thanks,
Kev