https://codesandbox.io/s/sweet-browser-kgzg3q?file=/src/App.js
I want the <Main />
component to have at least width 1000px and if it doesn’t, want a scroll-x to appear. But it doesn’t.
Any clue here? Help me css ninja!
https://codesandbox.io/s/sweet-browser-kgzg3q?file=/src/App.js
I want the <Main />
component to have at least width 1000px and if it doesn’t, want a scroll-x to appear. But it doesn’t.
Any clue here? Help me css ninja!
2
Answers
Correct me if I’m wrong, but it appears that the width properties of both the grid element and each direct child is overwritten by the grid-template-columns property. Therefore you need to create a child inside the Main component that sets the min-width and scroll properties there. I forked your code and have written an example. I believe this is what you are looking for.
You have the following structure:
The problem is that
<LargeText>
needs to overflow the<Main>
in order for horziontal scrollbar to appear.Change this…
…to this.
See the forked snippet.
App.js