I have a design like:
Where I have custom numbering style for my <ol>
list items. The issue I'm facing is that I have a heading and subheading as the contents of the <li>
and I can't seem to get it into the vertical stack that the design wants...
So far I have tried:
* {
font-family: arial;
}
ol {
list-style: none;
counter-reset: test;
}
li {
counter-increment: test;
}
li:before {
width: 24px;
height: 24px;
border-radius: 50%;
padding-left: 7px;
box-sizing: border-box;
display: inline-flex;
text-align: center;
align-items: center;
content: counter(test);
background: black;
color: white;
}
.head {
font-weight: bold;
}
<ol>
<li>
<div class="head">Item 1</div>
<div class="sub-head">Some text</div>
</li>
</ol>
As you can see, I have the number styled, but I am seeing that the actual contents are columnised...
If I add display: inline-flex;
to the <li>
it sets them all in a row but then I can't seem to get the contents into a column... Without adding a wrapper to them.
Is there a way in which I can achieve my desired look without having to add a wrapper to the contents?