💨
Sticky Header作ってみる
Sticky Header作ってみる
header {
position: sticky;
top: 0;
height: 50px;
background-color: #DC4136;
}
main div {
width: 300px;
height: 300px;
background-color: #F8D421;
margin-bottom: 50px;
}
import React from 'react'
import './Hoge.css'
export const Hoge = () => {
return (
<>
<header>header</header>
<main>
<div>aaaa</div>
<div>aaaa</div>
<div>aaaa</div>
<div>aaaa</div>
<div>aaaa</div>
</main>
</>
)
}
結果
Discussion