I am currently working with material-ui and react, and facing an issue with the positioning of a top bar within a Grid element. The top bar is meant to be fixed in its position, but not at the very top of the page as it is inside a parent Grid element.
I have attempted to fix the positioning of the top bar (child) using the following CSS:
navigation: {
position: 'fixed',
maxWidth: '47vw',
}
The code for the Grid element (parent) is as follows:
root: {
maxWidth: '100vw',
}
The problem arises when the width of the Grid element (parent) changes, causing the top bar to overlap another adjacent Grid element. How can this overlapping issue be resolved? Is there a solution involving the flex property in CSS that can inherit the properties of the parent?