ul {
padding: 0;
margin: 0;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
li {
display: flex;
margin: 1px;
padding: 5px;
background: #aaa;
}
li:last-child {
background: #ddd;
}
<ul>
<li>must always be in the center & occupy width of its text</li>
<li>text must start where 1'st item's text ends</li>
</ul>
I need first item to always be in the middle and occupy only the width of it's text; second item's text must begin exactly where the text of the 1st item ends.