Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to make sure footer is fixed at bottom of page


//Index.html
<html>
 <head>
   <link rel="stylesheet" type="text/css" href="main.css" />
 </head>

<body>
 <div id="page-container">
   <div id="content-wrap">
     <!-- all other page content -->
   </div>
   <footer id="footer"></footer>
 </div>
</body>

</html>

//CSS FILE 
#page-container {
  position: relative;
  min-height: 100vh;
}

#content-wrap {
  padding-bottom: 2.5rem;    /* Footer height */
}

#footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 2.5rem;            /* Footer height */
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: loop through json object javascript 
Javascript :: nextelementsibling js 
Javascript :: js settimeout 
Javascript :: parsefloat.tofixed in javascript 
Javascript :: react native text area align top 
Javascript :: onresize js 
Javascript :: jquery destroy element 
Javascript :: how to fix eslint error no-prototype-builtins 
Javascript :: firebase get current user javascript 
Javascript :: javascript division get remainder 
Javascript :: cors header missing vue api gateway 
Javascript :: javascript add quote comma 
Javascript :: jquery all elements whose id contains 
Javascript :: trigger ctrl + p or print page with javascript 
Javascript :: geolocation in javascript 
Javascript :: jquery text replace 
Javascript :: clear canvas for redrawing 
Javascript :: fetch post image mdn 
Javascript :: get alert after using ajax 
Javascript :: javascript is variable a string 
Javascript :: retrieve object array value based on key 
Javascript :: tab navigation react-native without title 
Javascript :: how to get url query string value in javascript 
Javascript :: match date regex 
Javascript :: vue.js cdn 
Javascript :: how to remove header in react navigation 
Javascript :: jquery scroll when object appear on screen make animation 
Javascript :: js string to date 
Javascript :: js append class 
Javascript :: hook access loopback 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =