li {
background-color: yellow;
}
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
I want to make the list items have both a background-color
and a width no longer than their content. But if I add the display: inline-block
property to them, then they all will appear next to each other. How could I fix this?