Guest User

Untitled

a guest
Jan 16th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.65 KB | None | 0 0
  1. /*footer */
  2. #footer .column {
  3. float: left;
  4. width: 25%;
  5. }
  6.  
  7. #footer .column div {
  8. margin: 5px;
  9. height: 200px;
  10. background: #eeeeee;
  11. }
  12.  
  13. <div id="footer">
  14. <div class="column"><div></div></div>
  15. <div class="column"><div></div></div>
  16. <div class="column"><div></div></div>
  17. <div class="column"><div></div></div>
  18. </div>
  19.  
  20. #footer {
  21. position:fixed;
  22. left:0px;
  23. bottom:0px;
  24. height:30px;
  25. width:100%;
  26. background:#999;
  27. }
  28.  
  29. /* IE 6 */
  30. * html #footer {
  31. position:absolute;
  32. top:expression((0-(footer.offsetHeight)+(document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight)+(ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop))+'px');
  33. }
  34.  
  35. <div id="container">
  36. <div id="header"></div>
  37. <div id="body"></div>
  38. <div id="footer"></div>
  39. </div>
  40.  
  41. html, body {
  42. margin:0;
  43. padding:0;
  44. height:100%;
  45. }
  46. #container {
  47. min-height:100%;
  48. position:relative;
  49. }
  50. #header {
  51. background:#ff0;
  52. padding:10px;
  53. }
  54. #body {
  55. padding:10px;
  56. padding-bottom:60px; /* Height of the footer */
  57. }
  58. #footer {
  59. position:absolute;
  60. bottom:0;
  61. width:100%;
  62. height:60px; /* Height of the footer */
  63. background:#6cf;
  64. }
  65.  
  66. <body>
  67. <header>
  68. <ul>
  69. <li><a href="#">Home</a></li>
  70. <li><a href="#">link1</a></li>
  71. <li><a href="#">link2</a></li>
  72. <li><a href="#">link3</a></li>
  73. <li><a href="#">link4</a></li>
  74. </ul>
  75. </header>
  76. <div class="wrapper">
  77. <div class="demo">
  78. <h1> H1</h1>
  79. <h2> h2</h2>
  80. <h3> h3</h3>
  81. <h4> h4</h4>
  82. <h5> h5</h5>
  83. <h6> h6</h6>
  84. <hr>
  85. <h1> H1</h1>
  86. <h2> h2</h2>
  87. <h3> h3</h3>
  88. <h4> h4</h4>
  89. <h5> h5</h5>
  90. <h6> h6</h6>
  91. <hr>
  92. <h1> H1</h1>
  93. <h2> h2</h2>
  94. <h3> h3</h3>
  95. <h4> h4</h4>
  96. <h5> h5</h5>
  97. <h6> h6</h6>
  98. </div>
  99. </div>
  100. <footer>
  101. <h1>kulbhushan charaya</h1>
  102. </footer>
  103. </body>
  104.  
  105. body {
  106. background: #ffffff none repeat scroll 0 0;
  107. padding:40px 0;
  108. }
  109. header{
  110. position:fixed;
  111. top:0;
  112. z-index:999;
  113. left:0;
  114. width:100%;
  115. background:#fff;
  116. border-bottom:1px solid #ccc;
  117. }
  118. header ul li {
  119. display: inline-block;
  120. list-style: outside none none;
  121. padding: 5px;
  122. }
  123. header ul li a {
  124. color: #000000;
  125. text-decoration: none;
  126. }
  127. footer {
  128. bottom: 0;
  129. left: 0;
  130. position: fixed;
  131. text-align: center;
  132. width: 100%;
  133. z-index: -1;
  134. }
  135. footer h1 {
  136. margin: 0;
  137. }
  138. .wrapper {
  139. background: #ffffff;
  140. padding: 0 15px;
  141. z-index: 1;
  142. }
  143.  
  144. html {
  145. position: relative;
  146. min-height: 100%;
  147. }
  148. body {
  149. /* Margin bottom by footer height */
  150. margin-bottom: 60px;
  151. }
  152. .footer {
  153. position: absolute;
  154. bottom: 0;
  155. width: 100%;
  156. /* Set the fixed height of the footer here */
  157. height: 60px;
  158. background-color: #f5f5f5;
  159. }
  160.  
  161. <footer class="footer">
  162.  
  163. </footer>
  164.  
  165. #main {padding-bottom: 150px;} /* Should have the same value of footer's height */
  166. #footer {position: relative;
  167. margin-top: -150px; /* footer's height */
  168.  
  169. <div id="wrap">
  170. <div id="content">
  171. /* Main body content */
  172. </div>
  173. </div>
  174.  
  175. <div id="footer">
  176. /* Footer content here */
  177. </div>
  178.  
  179. html, body, #wrap {
  180. height: 100%;
  181. }
  182. #wrap {
  183. height: auto;
  184. min-height: 100%;
  185. }
  186. #content {
  187. overflow: hidden;
  188. padding-bottom: (footer height);
  189. }
  190. #footer {
  191. position: relative;
  192. margin-top: -(footer height); /* Note the negative value */
  193. height: (footer height);
  194. clear:both;
  195. }
  196.  
  197. <body>
  198. <div class="top-nav">My Nav Bar</div>
  199. <div class="main-container">
  200. All my content
  201. </div>
  202. <div class="footer">
  203. My footer
  204. </div>
  205. </body>
  206.  
  207. .top-nav {
  208. height: 4rem;
  209. }
  210. .main-container {
  211. min-height: calc(100vh - 4rem - 4rem);
  212. }
  213. .footer {
  214. height: 4rem;
  215. }
  216.  
  217. .main-container {
  218. min-height: calc(100vh - #{$top-nav-height} - #{$footer-height});
  219. }
Add Comment
Please, Sign In to add comment