Skip to content

Instantly share code, notes, and snippets.

<div class="items a">
<h3>A</h3>
<p>a first thing</p>
<p>another thing</p>
<p>another thing</p>
<p>another thing</p>
<p>another thing</p>
</div>
<div class="items b">
<p>banother thing</p>

Multiple Sticky Titles with CSS and JS

On some mobile platforms there are alphabetical lists that use the letter as a title. As you scroll down the list the title follows you until you get to the next one. This snippet emulates this functionality.

A Pen by Chris Spittles on CodePen.

License.