Coding task · Next.js course · Module 3: Styling and Visual Optimization

Practice: RootLayout with Tailwind CSS

Layouts in Next.js are templates that wrap pages. /app/layout.tsx is the root layout - every page inherits it. Use {children} to render pages. Perfect for navigation, footer, themes!

Task

Create /app/layout.tsx: export default function RootLayout({ children }) { return <html><body><nav className='main-nav'>CodeWorlds</nav>{children}<footer>&copy; 2024</footer></body></html> }. All pages will inherit this layout!