How to make a page height = the viewport height
Hi all,
I am trying to make it so that my backoffice pages are the exact height of the viewport to give it an 'app like' feel, how can that be achieved?
7 Replies
Hey, you can use h-screen
either h-screen or h-dvh for dynamic height which might be better for mobile
@∂Max h-screen doesnt seem to work. parts of my page still fall below the viewport
Do you have a margin or something?
@isakwang margin where?
Up top
But I can send you a snippet later that works
assuming that is your app.vue you need an h-screen first
This fills the screen
<template>
<div class="h-screen">
<header class="bg-slate-800 h-16 text-center text-white">
This is the header
</header>
<Placeholder class="h-full" />
</div>
</template>
This doesn´t
<template>
<div class="h-full">
<header class="bg-slate-800 h-16 text-center text-white">
This is the header
</header>
<Placeholder class="h-full" />
</div>
</template>
@isakwang I am using nuxt with layouts.
this is layout/default.vue
How do i manage it if i have the header and footer separated from the page comopnent that is rendering the page itself