I am trying to create a numbered order list that has a border around it (making a circle). I want the number of the list to be centered in the border box and the border box to be centered within the paragraph. Right now both items are centered at the top (the number is centered to the top of the border box and the border box is centered at the top of the paragraph). I want the border box (circle) to adjust with the paragraph size. So if my paragraph takes up 3 lines then the circle will be in the middle of those three lines. If it takes up 5 lines, then the circle will appear in the middle of those 5 lines.
HTML
<ol>
<li>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat
</li>
<li>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</li>
<li>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat
</li>
<li>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</li>
</ol>
CSS
li{
margin-top: 20px;
margin-right: 30%;
font-size: 20px;
}
ol {
counter-reset:li; /* Initiate a counter */
margin-left:0; /* Remove the default left margin */
padding-left:0; /* Remove the default left padding */
}
ol > li {
position:relative; /* Create a positioning context */
margin:0 30% 20px 4.5em; /* Give each list item a left margin to make room for the numbers */
padding:4px 8px; /* Add some spacing around the content */
list-style:none; /* Disable the normal item numbering */
}
ol > li:before {
content:counter(li); /* Use the counter as content */
counter-increment:li; /* Increment the counter by 1 */
/* Position and style the number */
position:absolute;
top: 0px;
left:-2.5em;
margin-right:8px;
padding:4px;
width: 50px;
height: 50px;
border-radius: 50%;
color:#fff;
background:blue;
font-weight:bold;
font-family:"Helvetica Neue", Arial, sans-serif;
text-align: center;
}