{"id":423,"date":"2015-11-06T11:55:25","date_gmt":"2015-11-06T11:55:25","guid":{"rendered":"http:\/\/fazilabdulkhadar.com\/?p=423"},"modified":"2021-02-23T09:41:49","modified_gmt":"2021-02-23T09:41:49","slug":"how-can-keep-the-footer-in-the-bottom-of-the-page","status":"publish","type":"post","link":"http:\/\/fazilabdulkhadar.com\/index.php\/2015\/11\/06\/how-can-keep-the-footer-in-the-bottom-of-the-page\/","title":{"rendered":"How can keep the footer in the bottom of the page"},"content":{"rendered":"<p>I have seen a lot of web developers struggled to maintain the footer at the bottom of the page.<\/p>\n<h3>Problem<\/h3>\n<p>Please see the image below.<\/p>\n<div class=\"slate-resizable-image-embed slate-image-embed__resize-full-width\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1033 lazyload\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" data-src=\"http:\/\/fazilabdulkhadar.com\/wp-content\/uploads\/2020\/09\/26.jpeg\" alt=\"\" width=\"322\" height=\"270\" data-sizes=\"auto\" data-srcset=\"http:\/\/fazilabdulkhadar.com\/wp-content\/uploads\/2020\/09\/26.jpeg 322w, http:\/\/fazilabdulkhadar.com\/wp-content\/uploads\/2020\/09\/26-300x252.jpeg 300w\" sizes=\"auto, (max-width: 322px) 100vw, 322px\" \/><\/div>\n<p>If a web page has more content, the footer will drop down to the bottom of the screen and the page end at the footer. The same have only less content the footer clings with the content and empty space would be created based on viewport height.<\/p>\n<p>We have seen many failed attempts from most of the developers to fix this issue with positioning in CSS or JavaScript instruction. But the solution to this problem is very simple.<\/p>\n<h3><strong>The\u00a0solution<\/strong><\/h3>\n<p>Please set your HTML and CSS codes in the following ways.<\/p>\n<div class=\"slate-resizable-image-embed slate-image-embed__resize-full-width\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1034 lazyload\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" data-src=\"http:\/\/fazilabdulkhadar.com\/wp-content\/uploads\/2020\/09\/27.jpeg\" alt=\"\" width=\"578\" height=\"202\" data-sizes=\"auto\" data-srcset=\"http:\/\/fazilabdulkhadar.com\/wp-content\/uploads\/2020\/09\/27.jpeg 578w, http:\/\/fazilabdulkhadar.com\/wp-content\/uploads\/2020\/09\/27-300x105.jpeg 300w\" sizes=\"auto, (max-width: 578px) 100vw, 578px\" \/><\/div>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1035 lazyload\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" data-src=\"http:\/\/fazilabdulkhadar.com\/wp-content\/uploads\/2020\/09\/28.jpeg\" alt=\"\" width=\"483\" height=\"406\" data-sizes=\"auto\" data-srcset=\"http:\/\/fazilabdulkhadar.com\/wp-content\/uploads\/2020\/09\/28.jpeg 483w, http:\/\/fazilabdulkhadar.com\/wp-content\/uploads\/2020\/09\/28-300x252.jpeg 300w\" sizes=\"auto, (max-width: 483px) 100vw, 483px\" \/><\/div>\n<div class=\"slate-resizable-image-embed slate-image-embed__resize-full-width\"><\/div>\n<p>You can solve this issue with the positioning in CSS. First, you have to set a container div (class &#8220;container&#8221; in the above picture) with the relative position which will include the header, content and the footer. \u00a0Set your header and page content inside the container. The page content must have the padding-bottom value which is equal to the height of the footer. At last, you can set the footer inside the container div and with absolute position.<\/p>\n<p>Please see the\u00a0<a href=\"http:\/\/codepen.io\/fanafazil\/pen\/ZbMKyY\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Demo<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have seen a lot of web developers struggled to maintain the footer at the bottom of the page. Problem Please see the image below. If a web page has more content, the footer will drop down to the bottom of the screen and the page end at the footer. The same have only less&hellip;<\/p>\n","protected":false},"author":1,"featured_media":424,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42,43],"tags":[],"class_list":["post-423","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-design","category-html"],"_links":{"self":[{"href":"http:\/\/fazilabdulkhadar.com\/index.php\/wp-json\/wp\/v2\/posts\/423","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/fazilabdulkhadar.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/fazilabdulkhadar.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/fazilabdulkhadar.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/fazilabdulkhadar.com\/index.php\/wp-json\/wp\/v2\/comments?post=423"}],"version-history":[{"count":3,"href":"http:\/\/fazilabdulkhadar.com\/index.php\/wp-json\/wp\/v2\/posts\/423\/revisions"}],"predecessor-version":[{"id":1037,"href":"http:\/\/fazilabdulkhadar.com\/index.php\/wp-json\/wp\/v2\/posts\/423\/revisions\/1037"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/fazilabdulkhadar.com\/index.php\/wp-json\/wp\/v2\/media\/424"}],"wp:attachment":[{"href":"http:\/\/fazilabdulkhadar.com\/index.php\/wp-json\/wp\/v2\/media?parent=423"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/fazilabdulkhadar.com\/index.php\/wp-json\/wp\/v2\/categories?post=423"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/fazilabdulkhadar.com\/index.php\/wp-json\/wp\/v2\/tags?post=423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}