I am finally learning CSS, but I am stuck on adding a fading, centered shadow behind text.
I’ve tried using text-shadow and box-shadow, but I have been unsuccessful. What I am trying to achieve:
I have found some potential solutions that use really complicated css, but I am hopeful a simpler solution exists that I am just missing.
Here is my markup:
#menu {
position: absolute;
top: 4.5em;
right: 0;
}
#menu ul {
display: inline-block;
}
#menu li {
display: block;
float: left;
text-align: center;
}
#menu li:hover a,
#menu li.active a,
#menu li.active span {}
#menu li a,
#menu li span {
padding: 1em 1.5em;
letter-spacing: 1px;
text-decoration: none;
text-transform: uppercase;
font-size: 0.8em;
color: black;
}
#menu .active a {
background: #2651a8;
border-radius: 6px;
color: rgba(255, 255, 255, 1);
}
#menu .icon {}
<div id="menu">
<ul>
<li class="active"><a href="#" accesskey="1" title="">Homepage</a></li>
<li><a href="#" accesskey="2" title="">FIRST</a></li>
<li><a href="#" accesskey="3" title="">SECOND</a></li>
<li><a href="#" accesskey="4" title="">THIRD</a></li>
<li><a href="#" accesskey="5" title="">FOURTH</a></li>
</ul>
</div>
2
Answers
Use
:before
and blurfilter
:Box shadow ways.