I have a collection of items that are aligned to the left within their surrounding <div>
.
#list-container:before {
content: 'The items:';
}
#list-container span {
display: block;
}
<div id="list-container">
<span>item1</span>
<span>item2</span>
<span>item3</span>
<span>item4</span>
<span>item5</span>
<span>item6</span>
</div>
I am looking to have the title ("The items") of the list appear on the same line as the first item ("item1"), without changing the alignment of the rest of the items (desired output shown below):
The items: item1
item2
item3
etc.
Not like this:
The items: item1
item2
item3
etc.
I am currently utilizing :before
to add "The items:," but it is appearing above "item1" (as seen in the snippet above).
Does anyone have a method to achieve having the title on the same line as the first item, without affecting the alignment?
Thanks.