[Vuejs]-Footer not sticky to bottom bootstrap 5.2.2

1👍

From the example where you got the code for the sticky footer, there is an external css file where the footer gets it’s stickyness from. I have copied it and I will paste here(Inline CSS)

Change your blade code to this:

<!DOCTYPE html>
<html class="h-100">

<head>
    <meta charset="utf-8" />
    <meta name="description" content="Website name" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
    <link href="{{ mix('/css/app.css') }}" rel="stylesheet"/>
    <link href="{{ asset('/css/offcanvas.css') }}" rel="stylesheet"/>
    <script src="{{ mix('/js/app.js') }}" defer></script>
        <style>
/* Sticky footer styles
-------------------------------------------------- */
html {
  position: relative;
  min-height: 100%;
}
body {
  margin-bottom: 60px; /* Margin bottom by footer height */
}
.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 60px; /* Set the fixed height of the footer here */
  line-height: 60px; /* Vertically center the text there */
  background-color: #f5f5f5;
}
</style>
</head>

<body class="d-flex flex-column h-100">
  @inertia
</body>

</html>

Leave a comment