Set Footer to Bottom of Page without using Fixed Position.
You would need to position your footer fixed
, then offset its height (110px
) from the bottom of the body or containing element (since it is taken out of the normal document flow), e.g: .container.body-content {padding-bottom: 110px;}
.container.body-content { padding-bottom: 110px; height: 1000px; /* Force height on body */}
.footer { position: fixed; bottom: 0; background-color: #ffd800; text-align: center; right: 0; left: 0; background-image: url(/Content/SiteImages/logosmall.png); background-repeat: no-repeat; height: 110px; border-top: 3px solid #082603;}
.footer p { position: absolute; top: 50%; left: 50%; margin-right: -50%; transform: translate(-50%, -50%); color: #082603; font-size: 150%; font-family: 'Baskerville Old Face'}
<div class="container body-content">
<div class="footer"> <p>Quote</p> </div>
</div>
How to make a footer fixed at bottom?
You can use new properties and values from CSS3.
For instance :
<body>
<div class="container"></div>
<div class="footer"></div>
</body>
For the CSS :
.container {
min-height: 90vh;
}
.footer {
height: 10vh;
}
This way, your footer will always be at the bottom, even if your container is null
How to stick footer to bottom (not fixed) even with scrolling
I think this might help you.
Just showing you the way how to achieve what you want.
html,body { margin: 0; padding: 0; height: 100%;}#wrapper { min-height: 100%; position: relative;}#header { background: #ededed; padding: 10px;}#content { padding-bottom: 100px; /* Height of the footer element */}#footer { background: #ffab62; width: 100%; height: 100px; position: absolute; bottom: 0; left: 0;}
<div id="wrapper">
<div id="header"> </div> <!-- #header -->
<div id="content"> </div> <!-- #content -->
<div id="footer"> </div> <!-- #footer -->
</div><!-- #wrapper -->
How to allows make footer on the bottom but not letting it cover content
Hii Fire Lost check this solution. in this solution, I have set header and footer position: relative
and both elements will be display top of the page and bottom of the page
you need to set fix height in the main tag. I have used 80px of header and 60px of the footer.
i have applied this min-height: calc(100vh - 140px);
css in wrapper element.
if this answer is valuable for you. plz upvote me.
<html>
<head>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
header {
position: relative;
height: 80px;
width: 100%;
background: #333333;
text-align: center;
font-size: 22px;
color: #fff;
padding: 25px 0;
}
main {
position: relative;
min-height: calc(100vh - 140px);
font-size: 24px;
display: flex;
align-items: center;
justify-content: center;
}
footer {
position: relative;
height: 60px;
width: 100%;
background: #333333;
text-align: center;
font-size: 22px;
color: #fff;
padding: 18px 0;
}
</style>
<head>
<body>
<header><p>Header</p></header>
<main><p>Body Content</p></main>
<footer><p>Footer</p></footer>
</body>
<html>
Related Topics
My Position: Sticky Element Isn't Sticky When Using Flexbox
How to Make the Items in the Last Row Consume Remaining Space in CSS Grid
Specify Multiple Attribute Selectors in Css
Does Element Width Include Padding
Meaning of Numbers in "Col-Md-4"," Col-Xs-1", "Col-Lg-2" in Bootstrap
How to Display a Reverse-Ordered List in Html
Opacity of Div'S Background Without Affecting Contained Element in Ie 8
CSS Transition with Linear Gradient
Make Child Visible Outside an Overflow:Hidden Parent
Css Native Variables Not Working in Media Queries
Content Url Does Not Display Image on Firefox Browser
How to Draw a Circle Sector in Css
How to Remove the Url from My Print Css, So the Web Address Doesn't Print
Add Line Break to ::After or ::Before Pseudo-Element Content