This is a Next.js project bootstrapped with create-next-app
.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.js
. The page auto-updates as you edit the file.
This project uses next/font
to automatically optimize and load Inter, a custom Google Font.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
Ways to center a div or an Node element in html using css.
Centering a div in CSS can be achieved using various methods, and the choice of method depends on the specific layout requirements and design constraints. Here are several ways to center a div:
Using Flexbox:
css Copy code .container { display: flex; justify-content: center; align-items: center; } Using Grid:
css Copy code .container { display: grid; place-items: center; } Using Absolute Positioning:
css Copy code .container { position: relative; } .centered { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } Using Margin Auto (Horizontal Centering):
css Copy code .container { margin-left: auto; margin-right: auto; } Using Text-Align (Inline Elements):
css Copy code .container { text-align: center; } Using Table-Cell and Vertical Align:
css Copy code .container { display: table; } .centered { display: table-cell; vertical-align: middle; } Using Flexbox with Column Direction for Vertical Centering:
css Copy code .container { display: flex; flex-direction: column; justify-content: center; height: 100vh; } Using Grid with Place-Content for Both Axes:
css Copy code .container { display: grid; place-content: center; height: 100vh; }