Happy Wednesday.
Could someone please help me with this footer that does not want to float (it isn’t sticky) please? (React + CSS)
CSS:
.container {
position: relative;
line-height: 1.5;
min-height: calc(100vh - 4rem);
display: flex;
align-items: center;
justify-content: center;
}
footer {
position: absolute;
font-size: small;
color: #fff;
background-color: #262626;
display: flex;
width: 100vw;
height: 4rem;
}
.footer-options {
width: 50vw;
display: flex;
justify-content: flex-start;
padding-inline-start: 20px;
align-items: center;
}
.footer-link {
padding: 0 20px;
list-style: none;
}
footer span {
width: 50vw;
display: flex;
justify-content: flex-end;
padding: 0 20px;
align-items: center;
}
@media (max-width: 600px) {
footer {
flex-wrap: wrap;
height: 5rem;
}
.footer-options {
width: 100vw;
flex-direction: row;
justify-content: center;
padding-inline-start: 0;
align-items: center;
}
footer span {
width: 100vw;
flex-direction: column;
text-align: center;
align-self: flex-start;
}
}
/* adjusting styling */
.editLayout,
.previewLayout {
width: 100%;
}
.editLayout {
background: #333;
height: 100vh;
}
.previewLayout {
height: 100vh;
}
#preview, #edit {
padding-left: 50px;
}
#preview {
height: 100%;
overflow-y: scroll;
overflow-x: hidden;
}
#edit {
width: 90%;
height: 90%;
background-color: inherit;
color: #ffffff;
border: none;
outline: none;
resize: none;
font-size: 14px;
margin-top: 20Px;
font-family: 'Source Code Pro', monospace;
}
header {
background-color: #262626;
color: #ffffff;
text-align: center;
padding: 15px 0;
font-weight: 700;
}
REACT:
...
return (
<React.Fragment>
<div className="container">
<section className="editLayout">
<header> Edit</header>
<textarea id="edit" value={input} onChange={handleChange}></textarea>
</section>
<section className="previewLayout">
<header><i class="mdi mdi-television-guide"></i>Preview</header>
<div id="preview" dangerouslySetInnerHTML={mark(input)} />
</section>
</div>
<footer>
<ul className="footer-options">
<li className="footer-link"><a href="#" className="footer-linktext">Legal</a></li>
<li className="footer-link"><a href="#" className="footer-linktext">Contact Us</a></li>
</ul>
<span>© 2019 Developed by Pat. All Rights Reserved.</span>
</footer>
</React.Fragment>
)
}