I need to create fixed header and footer for all pages

3

I'm a beginner on programming and I'm not able to insert fixed header and footer on every page of the site. I saw here on the site an option with RenderBoy and RenderSection but I confess I did not understand. The site in question is simple and has few pages. Is there a simple way to do this?

    
asked by anonymous 02.04.2017 / 19:55

1 answer

2

This code sets the header and footer.

CSS:

footer {
 width: 100%;
 position: fixed;
 bottom: 0;
 right: 0;
 background: black;
 color: white;
 height: 40px;
 display: flex;
}
header {
 width: 100%;
 position: fixed;
 top: 0;
 left: 0;
 color: white;
 background: black;
 height: 40px;

}

HTML:

<html>
 <body>
  <header>
   Este é o cabeçalho
  </header>
   este é o corpo
  <footer>
    Este é o rodapé
  </footer>
 </body>
</html>

The CSS rules that are important to the desired effect are:

position: fixed

top: 0 bottom: 0 right: 0 left: 0

They instruct the code to fix the elements and in what positions.

From this, it is easy to adapt to your case.

    
02.04.2017 / 20:14