Given a HTML list like
<h1>Agenda</h1>
<ol id="agenda">
<li>First Topic</li>
<li>Second Topic</li>
<li>Third Topic</li>
<li>Fourth Topic</li>
<li>Fifth Topic</li>
</ol>
I try to style it like this image
styled list items having box and triangle
But I don't know how to format the items having a triangle on the right side.
I do have
html {
font-size:62.5%
}
body {
font-size:4rem;
font-weight:normal;
counter-reset:agenda
}
ol {
list-style-position:inside;
list-style-type:none;
padding-left:3rem
}
ol li {
margin:0.75rem 0;
vertical-align:middle
}
ol#agenda li::before {
counter-increment:agenda;
content:counter(agenda);
background-color:#58595b;
color:#fff;
padding:0.5rem 1rem;
margin-right:3rem
}
This gives me a box around the counter but misses the triangle. I thought about adding a background-image, but that must be stylable with a color and responsive so when I change the font size the list items must scale as well.
How can I add the triangle? Or is there another solution for that?
Thanks in advance
update
I don't want to style a div or span directly. I want to style the list items of a ordered or unordered list. I know that one can add a triangle using pseudo elements ::before and ::after. But that is not suitable for me because in all solutions I found the elements are style having
before {
content: '';
width: 0;
height: 0;
}
But as I want to add content (the numbers of the counter) I can't do that trick to get the arrow triangle.