I’m trying to do something like so:
a link here
------------------
another link here
------------------
>> active link here
------------------
one more link
------------------
where all the --- are borders but equal lengths. If the current page is the link (i.e. active link) then >> display (it’ll be an image). The problem is that if I add padding to the lis then it’ll cause the border to be underneath the >> which is not desired. No javascript obviously.
The general markup I’ve tried to work with is this:
<ul>
<li><a href="#">a link here</a></li>
<li><a href="#">another link here</a></li>
<li><a href="#">active link here</a></li>
<li><a href="#">one more link</a></li>
</ul>
I’d suggest applying the
.activeclass to theli, rather than the link, and then using:JS Fiddle demo.
Given the difficulties using the
:beforepseudo-element cross-browser, it seems worthwhile pointing out thatlist-style-imagecan be used instead:JS Fiddle demo.
References:
:before.list-style-image.