I am coding in ReactJS. I have a bottom NavBar and contents of my homepage. I want the content of my homepage to be centered relative to the bottom navigation bar. I fail to realize how to achieve that for two siblings.
const HomeLogo = () => {
return (
<Container className="homeLogo">
<Row className="d-flex justify-content-center">
<Image src={logo}/>
</Row>
</Container>
);
};
export const Home = () => {
return (
<>
<HomeLogo />
<NavBar />
</>
);
};
This is my CSS:
.homeLogo {
margin: 0;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
I want the top and bottom of the logo to be of equal length. Please see image 1
Here is the Sandbox link for the code:
https://codesandbox.io/s/long-wood-4tzin?file=/src/components/Home.js
