position:stickyを利用すると、javascriptなしで、表テーブルやサイドバーの特定要素の位置を途中で固定することができます。 
		
		
			
			
			
			
				
					
				|  |     <header>Header</header>     <div class="container">       <div class="flex-wrap">         <main>Main Contents</main>         <aside>           <div class="sidebar-element se1">サイドバー要素1</div>           <div class="sidebar-element se2">サイドバー要素2</div>           <div class="sidebar-element se3">サイドバー要素3</div>         </aside>       </div>     </div> | 
				
			 
		 
 
		
		
			
			
			
			
				
					
				| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | body { text-align: center; } .container {   width: 1000px;   margin: 0 auto; }   header {   background-color: pink;   line-height: 80px;   margin-bottom: 60px; } .flex-wrap {   display: flex;   justify-content: space-between; } main {   background-color: bisque;   line-height: 2000px;   width: calc(60% - 30px); } aside { width: calc(40% - 30px); } .sidebar-element{   line-height: 300px;   margin-bottom: 30px; } .se1{ background-color: rgb(198, 229, 255); }   .se2{ background-color: rgb(172, 214, 251); }   .se3{   background-color: rgb(129, 192, 247);   position: sticky;   top: 0; } | 
				
			 
		 
 今回はposition: stickyの使い方を解説します。     ※本記事ではpositionプロパティのstatic・relative・absolute・fixedの使い方について解説していません。これらにつ ...