What is a sticky footer? - html

This question is a total noob one, but I can't get the difference between a normal footer and a sticky footer.

Taken from CSS tricks:
The purpose of a sticky footer is that it "sticks" to the bottom of
the browser window. But not always, if there is enough content on the
page to push the footer lower, it still does that. But if the content
on the page is short, a sticky footer will still hang to the bottom of
the browser window.
Here is a clear idea of what a Sticky footer is: https://css-tricks.com/couple-takes-sticky-footer/
And
http://css-tricks.com/sticky-footer/
And an example: https://getbootstrap.com/docs/4.0/examples/sticky-footer/

From CSS Tricks,
The purpose of a sticky footer is that it "sticks" to the bottom of the browser window. But not always, if there is enough content on the page to push the footer lower, it still does that. But if the content on the page is short, a sticky footer will still hang to the bottom of the browser window.

I would guess a sticky footer is one that stays fixed to the bottom of a page, regardless of the length of content. Like this.

I assume a sticky footer stays at the same place on a screen all the time. In what context?

A sticky footer is anchored to the bottom of the browser view port, as opposed to the bottom of the entire page. It retains its position relative to the bottom of the browser as the page scrolls.

the sticky footer will always remain at a fixed position on the screen no matter you scroll or not.It will be visible all the time at that specific place.

You can zoom out this page : http://maedeh.arianblog.com/ and also http://stackoverflow.com and compare what happens for their footers!
hope it helps!

This CSS sticky footer code pushes a website's footer to the bottom of a browser window. It is valid CSS and HTML with no unsavory hacks, so it works in all of the major browsers (even the now defunct IE5 and IE6).
How to use the CSS Sticky Footer on your website,
Add the following lines of CSS to your stylesheet. The negative value for the margin in .wrapper is the same number as the height of .footer and .push. The negative margin should always equal to the full height of the footer (including any padding or borders you may add).
Follow this HTML structure. No content can be outside of the .wrapper and .footer div tags unless it is absolutely positioned with CSS. There should also be no content inside the .push div as it is a hidden element that "pushes" down the footer so it doesn't overlap anything.

Related

how do i stop my sticky footer being pushed below the fold

i have tried to implement one of bootstraps sticky footers into my cms. The sticky footer is fine until i add images to it which then the copyright note gets pushed below the fold.
You can see it here-> http://newrycreates.com/contact
What it looks like:
What it should look like:
I suggest using Developer tools in Chrome or Firebug for Firefox to hel debug this issue. A quick look at you elements shows the footer has a set height of 80px yet the image is 100px high. Change the height of your footer appropriatly.
You have positioned the base of the footer at the bottom of the page, however the contetns of the footer overflow this, hence your problem. The MDN on css overflow adds some light to this.

Fixed footer gets cut off horizontally

I've been going mad trying to fix the responsiveness issue on a site I'm working on, and I can't find any solutions here or anywhere else. The main problem is my fixed footer. On the landing page of the site, there's a header, main area, and footer (the page expands when arrow clicked on, but that's irrelevant).
I've attached the footer to the bottom of the page using fixed positioning. When the screen width is >1024px, the header, main, and footer widths are 100%. Below 1024px, the header and footer widths become static (with 1024 as the static width).
The problem is, there comes a point where the footer should be overflowing on the right side of the screen (since the width becomes fixed). I can scroll right to see the rest of the menu in the header, but the footer doesn't scroll to the right. Rather, it just cuts off everything that would normally be there.
I've tried to recreate the issue in Codepen with the relevant code here: http://cdpn.io/iCJct but it doesn't act the same as the website (located here: http://dev.longviewsources.com/).
Thank you for your help!
The problem is that the footer, with position: fixed is fixed relative to the browser window rather than to your content so when the user scrolls, it moves and the user never sees it. You can use position: absolute; to fix the element to a position relative to the body which is much more controllable. From there you can make the body's height 100% and use a container with an overflow: scroll;
I made a fiddle to demonstrate: http://jsfiddle.net/jaredkhan/ywrx2/2/

How to have my footer expanded on the bottom of my window browser

I have a web site where I use a footer with a black background. On long pages, my footer is correctly adjusted on the bottom of my page. The problem occurs on small pages when I don't have any scrollbars. In this case, my footer in not at the bottom of my window browser and after the footer (with black background) we still see white background after the footer.
How can I proceed to have my black footer expanded until the bottom of my window browser?
Here is a live example: http://jsbin.com/okobeh/2/edit#javascript,html,live
On this example, you see my footer and below this footer we see white space.
Thanks.
May be you want sticky footer technique check this http://ryanfait.com/sticky-footer/ .
Check this http://jsbin.com/okobeh/4/edit#html,live
position: fixed and bottom:0px: http://jsbin.com/okobeh/3/edit#preview
Lookup in the code of this example http://webmolot.com/recipe/css/element6/
If "position: fixed and bottom:0px" then add margin-bottom:{height_of_footer}px; to the content block (#body)
I believe you are looking for: http://jsfiddle.net/pratik136/Sz8ex/
Besides the changes to your CSS, I have added some HTML changes. An outer div that encloses the Header, Body and Footer.

CSS content area of our site is scrolling when it should not

Ok, so the issue is I have a header, footer and the content div and what I want is for the content div to auto fill the height of the browser between header and footer making the footer stay on the bottom of the page, or below the content length.
when you go to incard.com.au you can see the issue on the index page as the content area is smaller then the browser window so we have added a height to the div to solve the footer floating issue.
I fixed it using jquery
$('#sitewidth').css({'height':(($(document).height())-320)+'px'});
$('#contentbody').css({'height':(($(document).height())-320)+'px'});
Remove the 'min-height: 700px' from #contentbody
So what is supposed to happen when the browser window is smaller than the height of the div?
You can set the height of the central div at 100 percent. For example, make the content div 100%, make the top and bottom fixed heights. That's kind of a hack but it works sometimes I think -- the 100% won't compress the fixed height top and bottom -- it "tries" to be 100%.
What I'm unclear about is what's supposed to happen as you make the browser window smaller. Is the header and footer supposed to stay glued to the top and bottom of your browser, while the content area gets smaller and smaller?
The only issue I see is that the orange borders on each side of your content area stop half-way down the page when the content doesn't reach the footer.
The most common way to fix this issue it to make those orange borders a background image and have it repeat-y inside of .sitewidth
I was able to fix the solution by using Javascript, it seems that to get the height of the content to fit the whole screen correctly I had to do a math thing where I took the height of the footer and header away from the browser screen size and then that gave me the min-size of my content body. as it is different on each users screen size it had to be a javascript set function.

How can I extend a div to bottom of page?

How can I extend a div to the bottom of the page? Let's say I have a div that starts at the top, and has a background image I want repeated to the bottom of the page. How would I go about doing this?
Live example found here: http://mibsolutionsllc.com/ecgridos/about/ with the #content div.
Switch it around, have the background for your content as the body tags back ground then over lay the header over the top of it via a div or other element :)
CSS Sticky Footer does something similar, they've got a solution that seems to work on a whole range of different (including very old) browsers. If you don't need the footer you can always still use their solution and set the footer height to 0px.