Created
October 22, 2020 13:23
-
-
Save PrestonII/aa2e3bcd8ab58710a07e81779295645d to your computer and use it in GitHub Desktop.
Create A 3 Row Container w/ A Scrollable Middle Row
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:root{ | |
font-size: 16px; | |
box-sizing: border-box; | |
} | |
html, body, #root { | |
width: 100%; | |
overflow-y: hidden; | |
height: 100%; | |
/* min-height: 100vh; */ | |
} | |
.App { | |
display: grid; | |
grid-template-rows: 10rem 1fr 10rem; | |
height: 100%; | |
border: 10px solid blue; | |
} | |
.element { | |
border: 1px solid red; | |
overflow-y: scroll; | |
} | |
.child { | |
height: 10rem; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
function App() { | |
return ( | |
<div className="App"> | |
<div className="element">Top</div> | |
<div className="element"> | |
<div className="child">Get</div> | |
<div className="child">this</div> | |
<div className="child">thing</div> | |
<div className="child">to</div> | |
<div className="child">work!</div> | |
</div> | |
<div className="element">Bottom</div> | |
</div> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment