Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tailwindcss: fixed/sticky footer on the bottom

I use tailwindCSS and confront a problem with make footer.

base.html

  <body>     {% include "partials/nav.html" %}      {% block content %}     {% endblock %}      {% include "partials/footer.html" %}   </body> 

footer.html

<footer class="w-full h-64 bg-gray-900 static bottom-0">         {% load static %}         <img src="{% static "images/logo_white.png" %}" width="70px"> <p class="text-white"> &copy~~~~~~</p> </footer> 

i tried static,absolute,fixed,relative... but .fixed cover the content block and relative make footer going upside. or .mb-0, .bottom-0 doesn't work.

is it possible make footer fixed on the bottom?

like image 810
dhooonk Avatar asked Jan 19 '20 16:01

dhooonk


People also ask

How do I fix the footer at bottom tailwind?

In Tailwind CSS, you can implement a fixed footer navigation menu by combining the fixed utility class with the bottom-0 (set bottom position to 0) and left-0 (set left position to 0) utility classes.

How do I make my footer stick to the bottom in Wordpress?

Use the WPFront Notification Bar Plugin To enable the floating footer bar, select the option to fix the bar at the bottom position. What is this? Change the position from “top” to “bottom”. Check the box to enable “fixed at position” which is what fixes it to the bottom of the screen.


1 Answers

<div class="flex flex-col h-screen justify-between">   <header class="h-10 bg-red-500">Header</header>   <main class="mb-auto h-10 bg-green-500">Content</main>   <footer class="h-10 bg-blue-500">Footer</footer> </div> 

Class justify-between is not required, but I would leave him (for other case).

So, play with h-screen and mb-auto classes.

And you get this UI:

enter image description here

like image 162
Dmitry S. Avatar answered Oct 05 '22 01:10

Dmitry S.