Posts > Sticky Navigation / Sidebar

Sticky Navigation / Sidebar

Creating sticky navigation or a sidebar? Here's a quick html and css only approach.


<div id="wrapper">
	<div class="aside">
	<div class="main">
		<!-- your content goes here -->


#wrapper {
  display: flex;
  align-items: start;

.aside {
  padding: 20px;
  background: tomato;
  position: sticky;
  top: 0;
  height: 100dvh; /* only if you need the sidebar full height */

.main {
  padding: 20px;
👌This is good when you want a sticky table of content on your post

Tags 🏷