Next.js Discord

Discord Forum

My div tag is not taking the full height of the parent in nextjs.

Unanswered
Tree Pipit posted this in #help-forum
Open in Discord
Tree PipitOP
So for some reason my div is not taking the full height of body tag and it's annoying. Does anyone have a solution? All my other projects it worked perfectly fine. Idk why it's happening here.

7 Replies

@ᴉuɐpɹɐɐ post your root layout
Tree PipitOP
It’s the default root layout
@Tree Pipit It’s the default root layout
post your src/app/layout.jsx
Tree PipitOP
import { Poppins } from "next/font/google";
import "./globals.css";

const poppins = Poppins({
subsets: ["latin"],
weight: ["100", "300", "400", "500", "700", "900"],
variable: "--font-poppins",
});

export const metadata = {
title: "Tenera",
description: "Generated by create next app",
};

export default function RootLayout({ children }) {
return (
<html lang="en">
<body className={${poppins.className}}>{children}</body>
</html>
);
}
use code block
add bg-red-500 to <section className="h-full">
then screenshot the browser view