sticky footer react
.footer{
margin-top: 1rem;
padding: 1rem;
background-color: rgb(235, 195, 64);
position: fixed;
bottom: 0;
left: 0;
width: 100%;
}
sticky footer react
.footer{
margin-top: 1rem;
padding: 1rem;
background-color: rgb(235, 195, 64);
position: fixed;
bottom: 0;
left: 0;
width: 100%;
}
React sticky header
// One way around it
// First off get react-sticky (npm/yarn etc..)
npm install react-sticky
// Then you could do something like...
import React from 'react';
import { StickyContainer, Sticky } from 'react-sticky';
// ...
class App extends React.Component {
render() {
return (
<StickyContainer>
{/* Other elements can be in between `StickyContainer` and `Sticky`,
but certain styles can break the positioning logic used. */}
<Sticky>
{({
style,
// the following are also available but unused in this example
isSticky,
wasSticky,
distanceFromTop,
distanceFromBottom,
calculatedHeight
}) => (
<header style={style}>
{/* ... */}
</header>
)}
</Sticky>
{/* ... */}
</StickyContainer>
);
},
};
how to make sticky footer with react router
<div id="container">
<Header loaded={loaded} />
<div id="main-content">
<Switch>
<Route
path="/about"
render={props => <About loaded={loaded} {...props} />}
/>
<Route
exact
path="/"
render={props => <MainPage loaded={loaded} {...props} />}
/>
<Redirect to="/" />
</Switch>
</div>
<Footer />
</div>
how to make sticky footer with react router
#container {
display: flex;
min-height: 100vh;
flex-direction: column;
}
#main-content {
flex: 1;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us