58. Footer and Heading FrontEnd

Now, we will focus on developing the front-end for the footer and heading of our website.

In the base.html file, copy the relevant lines from home.html (found in the FrontEnd folder) that are currently missing. Update base.html to include these lines so it matches the layout of the provided home.html.

base.html
<link rel="stylesheet" type="text/css" href="{% static 'css/main.css' %}">
    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />

    <link
      href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap"
      rel="stylesheet"
    />
</head>

Note: If you previously included a link to the Font Awesome CSS, you can remove it, as we will use the fonts already imported from the FrontEnd folder.

Next, import the footer section from home.html into base.html.

To do this efficiently and in an organized manner, create a new HTML file called footer.html inside the templates folder. Paste the code from the <footer> tag of home.html (found in the FrontEnd folder) into this new footer.html file.

In base.html, before the section where JavaScript files are referenced, include the footer.html using the following line of code:

base.html
    {% include 'footer.html' %}

Now, the footer will appear at the bottom of every page, as it is included in base.html, which is used across all HTML files.

Last updated