<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Himanshu Sahu</title>
    <description>The latest articles on DEV Community by Himanshu Sahu (@himanshu_99).</description>
    <link>https://dev.to/himanshu_99</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F647809%2Fe954c083-0e4c-4ac0-8f2d-5e11929a8dd0.png</url>
      <title>DEV Community: Himanshu Sahu</title>
      <link>https://dev.to/himanshu_99</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/himanshu_99"/>
    <language>en</language>
    <item>
      <title>How to place footer at the bottom of page or content which is lower.</title>
      <dc:creator>Himanshu Sahu</dc:creator>
      <pubDate>Fri, 13 May 2022 08:59:52 +0000</pubDate>
      <link>https://dev.to/himanshu_99/hot-place-footer-at-bottom-of-page-or-content-which-is-lower-2c3d</link>
      <guid>https://dev.to/himanshu_99/hot-place-footer-at-bottom-of-page-or-content-which-is-lower-2c3d</guid>
      <description>&lt;p&gt;First create a container which contains all the elements or components. Then create header, main-content, and footer.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HTML
&amp;lt;div class="container"&amp;gt;
         &amp;lt;div class="header"&amp;gt;This is navbar/header&amp;lt;/div&amp;gt;
         &amp;lt;div class="main-content"&amp;gt;&amp;lt;/div&amp;gt;
         &amp;lt;div class="footer"&amp;gt;This is footer&amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add some styling to the main container as it will contain all our data, so we are using flex and flex direction column. We also giving min-height: 100vh so that the container will have the full height of the viewport.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container{
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we will add some styling to the footer we have to give bottom:0; so that it will stick to the bottom of container and we also have to give margin-top : auto; so it will push the footer to bottom as mush as possible.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.header{
    width: 100%;
    background-color: bisque;
    height: 8vh;
    text-align: center;
}
.main-content{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: azure;
}
.footer{
    bottom: 0;
    margin-top: auto;
    text-align: center;
    background-color: rgb(154, 178, 178);
    width: 100%;
    height: 8vh;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>html</category>
      <category>css</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
